Class: Proxy::Omaha::MetadataProvider
- Inherits:
-
Object
- Object
- Proxy::Omaha::MetadataProvider
- Defined in:
- lib/smart_proxy_omaha/metadata_provider.rb
Instance Attribute Summary collapse
-
#contentpath ⇒ Object
Returns the value of attribute contentpath.
Instance Method Summary collapse
- #get(track, release, architecture) ⇒ Object
-
#initialize(options) ⇒ MetadataProvider
constructor
A new instance of MetadataProvider.
- #store(metadata) ⇒ Object
Constructor Details
#initialize(options) ⇒ MetadataProvider
Returns a new instance of MetadataProvider.
5 6 7 |
# File 'lib/smart_proxy_omaha/metadata_provider.rb', line 5 def initialize() @contentpath = .fetch(:contentpath) end |
Instance Attribute Details
#contentpath ⇒ Object
Returns the value of attribute contentpath.
3 4 5 |
# File 'lib/smart_proxy_omaha/metadata_provider.rb', line 3 def contentpath @contentpath end |
Instance Method Details
#get(track, release, architecture) ⇒ Object
9 10 11 |
# File 'lib/smart_proxy_omaha/metadata_provider.rb', line 9 def get(track, release, architecture) Metadata.new(JSON.parse(File.read((track, release, architecture)))) end |
#store(metadata) ⇒ Object
13 14 15 16 17 18 |
# File 'lib/smart_proxy_omaha/metadata_provider.rb', line 13 def store() File.open((.track, .release, .architecture), 'w') do |file| file.write(.to_json) end true end |