Class: GemGuard::Dependency

Inherits:
Object
  • Object
show all
Defined in:
lib/gem_guard/parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, version:, source:, dependencies: []) ⇒ Dependency

Returns a new instance of Dependency.



92
93
94
95
96
97
# File 'lib/gem_guard/parser.rb', line 92

def initialize(name:, version:, source:, dependencies: [])
  @name = name
  @version = version
  @source = source
  @dependencies = dependencies
end

Instance Attribute Details

#dependenciesObject (readonly)

Returns the value of attribute dependencies.



90
91
92
# File 'lib/gem_guard/parser.rb', line 90

def dependencies
  @dependencies
end

#nameObject (readonly)

Returns the value of attribute name.



90
91
92
# File 'lib/gem_guard/parser.rb', line 90

def name
  @name
end

#sourceObject (readonly)

Returns the value of attribute source.



90
91
92
# File 'lib/gem_guard/parser.rb', line 90

def source
  @source
end

#versionObject (readonly)

Returns the value of attribute version.



90
91
92
# File 'lib/gem_guard/parser.rb', line 90

def version
  @version
end

Instance Method Details

#==(other) ⇒ Object



99
100
101
102
103
104
# File 'lib/gem_guard/parser.rb', line 99

def ==(other)
  other.is_a?(Dependency) &&
    name == other.name &&
    version == other.version &&
    source == other.source
end