Class: Derelict::Box
- Inherits:
-
Object
- Object
- Derelict::Box
- Defined in:
- lib/derelict/box.rb,
lib/derelict/box/manager.rb,
lib/derelict/box/not_found.rb
Overview
Represents an individual Vagrant box for a particular provider
Defined Under Namespace
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#provider ⇒ Object
readonly
Returns the value of attribute provider.
Instance Method Summary collapse
-
#==(other) ⇒ Object
(also: #eql?)
Ensure equivalent Boxes are equal to this one.
-
#hash ⇒ Object
Make equivalent Boxes hash to the same value.
-
#initialize(name, provider) ⇒ Box
constructor
Initializes a box with a particular name and provider.
Constructor Details
#initialize(name, provider) ⇒ Box
Initializes a box with a particular name and provider
* name: The name of the box represented by this object
* provider: The provider of the box represented by this object
13 14 15 16 |
# File 'lib/derelict/box.rb', line 13 def initialize(name, provider) @name = name @provider = provider end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/derelict/box.rb', line 7 def name @name end |
#provider ⇒ Object (readonly)
Returns the value of attribute provider.
7 8 9 |
# File 'lib/derelict/box.rb', line 7 def provider @provider end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
Ensure equivalent Boxes are equal to this one
19 20 21 |
# File 'lib/derelict/box.rb', line 19 def ==(other) other.name == name and other.provider == provider end |
#hash ⇒ Object
Make equivalent Boxes hash to the same value
25 26 27 |
# File 'lib/derelict/box.rb', line 25 def hash name.hash ^ provider.hash end |