Class: Bosh::Cli::PackageBuilder::GlobMatch
- Defined in:
- lib/cli/package_builder.rb
Instance Attribute Summary collapse
-
#dir ⇒ Object
readonly
Helper class encapsulating the data we know about the glob.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#eql?(other) ⇒ Boolean
GlobMatch will be used as Hash key (as implied by using Set), hence we need to define both eql? and hash.
- #full_path ⇒ Object
- #hash ⇒ Object
-
#initialize(dir, path) ⇒ GlobMatch
constructor
A new instance of GlobMatch.
Constructor Details
#initialize(dir, path) ⇒ GlobMatch
Returns a new instance of GlobMatch.
12 13 14 15 |
# File 'lib/cli/package_builder.rb', line 12 def initialize(dir, path) @dir = dir @path = path end |
Instance Attribute Details
#dir ⇒ Object (readonly)
Helper class encapsulating the data we know about the glob. We need both directory and file path, as we match the same path in several directories (src, src_alt, blobs)
9 10 11 |
# File 'lib/cli/package_builder.rb', line 9 def dir @dir end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
10 11 12 |
# File 'lib/cli/package_builder.rb', line 10 def path @path end |
Instance Method Details
#<=>(other) ⇒ Object
21 22 23 |
# File 'lib/cli/package_builder.rb', line 21 def <=>(other) @path <=> other.path end |
#eql?(other) ⇒ Boolean
GlobMatch will be used as Hash key (as implied by using Set), hence we need to define both eql? and hash
27 28 29 |
# File 'lib/cli/package_builder.rb', line 27 def eql?(other) @path == other.path end |
#full_path ⇒ Object
17 18 19 |
# File 'lib/cli/package_builder.rb', line 17 def full_path File.join(dir, path) end |
#hash ⇒ Object
31 32 33 |
# File 'lib/cli/package_builder.rb', line 31 def hash @path.hash end |