Class: Gurney::Dependency

Inherits:
Object
  • Object
show all
Defined in:
lib/gurney/dependency.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#ecosystemObject (readonly)

Returns the value of attribute ecosystem.



4
5
6
# File 'lib/gurney/dependency.rb', line 4

def ecosystem
  @ecosystem
end

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/gurney/dependency.rb', line 4

def name
  @name
end

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