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(xml) ⇒ Object



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

def self.parse xml
  document = Nokogiri::XML xml
  document.search('feature').collect do |feature_element|
    feature = Feature.new
    feature.content = feature_element.text.strip
    feature.name = feature_element.attribute('name').to_s
    feature
  end  
end