Class: Bosh::Cli::PackageBuilder::GlobMatch

Inherits:
Object
  • Object
show all
Defined in:
lib/cli/package_builder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#dirObject (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

#pathObject (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

Returns:

  • (Boolean)


27
28
29
# File 'lib/cli/package_builder.rb', line 27

def eql?(other)
  @path == other.path
end

#full_pathObject



17
18
19
# File 'lib/cli/package_builder.rb', line 17

def full_path
  File.join(dir, path)
end

#hashObject



31
32
33
# File 'lib/cli/package_builder.rb', line 31

def hash
  @path.hash
end