Skip to content

Instantly share code, notes, and snippets.

@smulube
Created March 30, 2009 00:07
Show Gist options
  • Save smulube/87579 to your computer and use it in GitHub Desktop.
Save smulube/87579 to your computer and use it in GitHub Desktop.
# Create an object from an eeml document
environment = Eeml::Environment.new_from_eeml(string_containing_eeml_representation)
# attributes available like this
puts environment.title
puts environment.description
puts environment.feed
# etc...
# alternatively would this be better?
puts environment[:title]
puts environment[:description]
environment.datastreams.each do |datastream|
puts datastream.stream_id
puts datastream.min_value
puts datastream.max_value
# etc...
end
location = environment.location
puts location.name
puts location.lat
puts location.lon
# etc...
# Create an object from a json document
environment = Eeml::Environment.new_from_json(string_containing_json_representation)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment