2016-09-24 13:52:43 +02:00
|
|
|
module Hbc
|
|
|
|
module Source
|
|
|
|
class Tapped
|
|
|
|
def self.me?(query)
|
2016-10-08 13:25:38 +02:00
|
|
|
Hbc.path(query).exist?
|
2016-09-24 13:52:43 +02:00
|
|
|
end
|
2016-08-18 22:11:42 +03:00
|
|
|
|
2016-09-24 13:52:43 +02:00
|
|
|
attr_reader :token
|
2016-08-18 22:11:42 +03:00
|
|
|
|
2016-09-24 13:52:43 +02:00
|
|
|
def initialize(token)
|
|
|
|
@token = token
|
|
|
|
end
|
2016-08-18 22:11:42 +03:00
|
|
|
|
2016-09-24 13:52:43 +02:00
|
|
|
def load
|
2016-10-08 13:25:38 +02:00
|
|
|
PathSlashOptional.new(Hbc.path(token)).load
|
2016-09-24 13:52:43 +02:00
|
|
|
end
|
2016-08-18 22:11:42 +03:00
|
|
|
|
2016-09-24 13:52:43 +02:00
|
|
|
def to_s
|
|
|
|
# stringify to fully-resolved location
|
2016-10-08 13:25:38 +02:00
|
|
|
Hbc.path(token).expand_path.to_s
|
2016-09-24 13:52:43 +02:00
|
|
|
end
|
|
|
|
end
|
2016-08-18 22:11:42 +03:00
|
|
|
end
|
|
|
|
end
|