Class: Derelict::Plugin

Inherits:
Object
  • Object
show all
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

Classes: Manager, NotFound

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nameObject (readonly)

Returns the value of attribute name.



7
8
9
# File 'lib/derelict/plugin.rb', line 7

def name
  @name
end

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

#hashObject

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