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