Class: Bumps::RemoteFeature

Inherits:
Object
  • Object
show all
Defined in:
lib/bumps/remote_feature.rb

Class Method Summary collapse

Class Method Details

.fetch(location) ⇒ Object



8
9
10
# File 'lib/bumps/remote_feature.rb', line 8

def self.fetch location
  parse(open(location){|f| f.read})
end

.parse(json) ⇒ Object



12
13
14
15
16
17
# File 'lib/bumps/remote_feature.rb', line 12

def self.parse json
  JSON.parse(json)['features'].collect do |id, feature|
    content = "@id:#{id} @version:#{feature['version']}\n#{feature['content']}"
    Feature.new(feature['name'], content)
  end
end