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