Class: Gemstar::CargoLockFile
- Inherits:
-
Object
- Object
- Gemstar::CargoLockFile
- Defined in:
- lib/gemstar/cargo_lock_file.rb
Instance Attribute Summary collapse
-
#spec_sources ⇒ Object
readonly
Returns the value of attribute spec_sources.
-
#specs ⇒ Object
readonly
Returns the value of attribute specs.
Instance Method Summary collapse
-
#initialize(path: nil, content: nil) ⇒ CargoLockFile
constructor
A new instance of CargoLockFile.
- #source_for(name) ⇒ Object
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_sources ⇒ Object (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 |
#specs ⇒ Object (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 |