Class: Gurney::Dependency
- Inherits:
-
Object
- Object
- Gurney::Dependency
- Defined in:
- lib/gurney/dependency.rb
Instance Attribute Summary collapse
-
#ecosystem ⇒ Object
readonly
Returns the value of attribute ecosystem.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(ecosystem:, name:, version:) ⇒ Dependency
constructor
A new instance of Dependency.
- #to_json(*args) ⇒ Object
Constructor Details
#initialize(ecosystem:, name:, version:) ⇒ Dependency
Returns a new instance of Dependency.
6 7 8 9 10 |
# File 'lib/gurney/dependency.rb', line 6 def initialize(ecosystem:, name:, version:) @ecosystem = ecosystem @name = name @version = version end |
Instance Attribute Details
#ecosystem ⇒ Object (readonly)
Returns the value of attribute ecosystem.
4 5 6 |
# File 'lib/gurney/dependency.rb', line 4 def ecosystem @ecosystem end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/gurney/dependency.rb', line 4 def name @name end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
4 5 6 |
# File 'lib/gurney/dependency.rb', line 4 def version @version end |
Instance Method Details
#==(other) ⇒ Object
20 21 22 23 24 25 |
# File 'lib/gurney/dependency.rb', line 20 def ==(other) other.class == self.class && other.ecosystem == ecosystem && other.name == name && other.version == version end |
#to_json(*args) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/gurney/dependency.rb', line 12 def to_json(*args) { ecosystem: @ecosystem, name: @name, version: @version, }.to_json(*args) end |