Class: Gemstar::CargoLockFile

Inherits:
Object
  • Object
show all
Defined in:
lib/gemstar/cargo_lock_file.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path: nil, content: nil) ⇒ CargoLockFile

Returns a new instance of CargoLockFile.



10
11
12
13
14
# File 'lib/gemstar/cargo_lock_file.rb', line 10

def initialize(path: nil, content: nil)
  parsed = parse_content(content || File.read(path))
  @specs = parsed[:specs]
  @spec_sources = parsed[:spec_sources]
end

Instance Attribute Details

#spec_sourcesObject (readonly)

Returns the value of attribute spec_sources.



8
9
10
# File 'lib/gemstar/cargo_lock_file.rb', line 8

def spec_sources
  @spec_sources
end

#specsObject (readonly)

Returns the value of attribute specs.



7
8
9
# File 'lib/gemstar/cargo_lock_file.rb', line 7

def specs
  @specs
end

Instance Method Details

#source_for(name) ⇒ Object



16
17
18
# File 'lib/gemstar/cargo_lock_file.rb', line 16

def source_for(name)
  spec_sources[name]
end