Class: Bosh::Cli::GlobMatch
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.
9 10 11 12 |
# File 'lib/cli/glob_match.rb', line 9 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)
6 7 8 |
# File 'lib/cli/glob_match.rb', line 6 def dir @dir end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
7 8 9 |
# File 'lib/cli/glob_match.rb', line 7 def path @path end |
Instance Method Details
#<=>(other) ⇒ Object
18 19 20 |
# File 'lib/cli/glob_match.rb', line 18 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
24 25 26 |
# File 'lib/cli/glob_match.rb', line 24 def eql?(other) @path == other.path end |
#full_path ⇒ Object
14 15 16 |
# File 'lib/cli/glob_match.rb', line 14 def full_path File.join(dir, path) end |
#hash ⇒ Object
28 29 30 |
# File 'lib/cli/glob_match.rb', line 28 def hash @path.hash end |