aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cask/lib/hbc/source/tapped.rb
blob: c1f5f95bcad43a8b7ca9f823c9cb4bf855f3816b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
module Hbc
  module Source
    class Tapped
      def self.me?(query)
        Hbc.path(query).exist?
      end

      attr_reader :token

      def initialize(token)
        @token = token
      end

      def load
        PathSlashOptional.new(Hbc.path(token)).load
      end

      def to_s
        # stringify to fully-resolved location
        Hbc.path(token).expand_path.to_s
      end
    end
  end
end