Class: Gemstar::PackageLockFile
- Inherits:
-
Object
- Object
- Gemstar::PackageLockFile
- Defined in:
- lib/gemstar/package_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) ⇒ PackageLockFile
constructor
A new instance of PackageLockFile.
- #source_for(name) ⇒ Object
Constructor Details
#initialize(path: nil, content: nil) ⇒ PackageLockFile
Returns a new instance of PackageLockFile.
5 6 7 8 9 10 |
# File 'lib/gemstar/package_lock_file.rb', line 5 def initialize(path: nil, content: nil) @path = path 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.
13 14 15 |
# File 'lib/gemstar/package_lock_file.rb', line 13 def spec_sources @spec_sources end |
#specs ⇒ Object (readonly)
Returns the value of attribute specs.
12 13 14 |
# File 'lib/gemstar/package_lock_file.rb', line 12 def specs @specs end |
Instance Method Details
#source_for(name) ⇒ Object
15 16 17 |
# File 'lib/gemstar/package_lock_file.rb', line 15 def source_for(name) spec_sources[name] end |