Class: Berkshelf::API::RemoteCookbook

Inherits:
Object
  • Object
show all
Defined in:
lib/berkshelf/api/remote_cookbook.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, version, location_type, location_path, priority, info = {}) ⇒ RemoteCookbook

Returns a new instance of RemoteCookbook.



10
11
12
13
14
15
16
17
# File 'lib/berkshelf/api/remote_cookbook.rb', line 10

def initialize(name, version, location_type, location_path, priority, info = {})
  @name          = name
  @version       = version
  @location_type = location_type
  @location_path = location_path
  @priority      = priority
  @info          = info
end

Instance Attribute Details

#infoObject

Returns the value of attribute info.



8
9
10
# File 'lib/berkshelf/api/remote_cookbook.rb', line 8

def info
  @info
end

#location_pathObject

Returns the value of attribute location_path.



6
7
8
# File 'lib/berkshelf/api/remote_cookbook.rb', line 6

def location_path
  @location_path
end

#location_typeObject

Returns the value of attribute location_type.



5
6
7
# File 'lib/berkshelf/api/remote_cookbook.rb', line 5

def location_type
  @location_type
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/berkshelf/api/remote_cookbook.rb', line 3

def name
  @name
end

#priorityObject

Returns the value of attribute priority.



7
8
9
# File 'lib/berkshelf/api/remote_cookbook.rb', line 7

def priority
  @priority
end

#versionObject

Returns the value of attribute version.



4
5
6
# File 'lib/berkshelf/api/remote_cookbook.rb', line 4

def version
  @version
end

Instance Method Details

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/berkshelf/api/remote_cookbook.rb', line 23

def eql?(other)
  self.hash == other.hash
end

#hashObject



19
20
21
# File 'lib/berkshelf/api/remote_cookbook.rb', line 19

def hash
  "#{name}|#{version}".hash
end