Created
March 30, 2009 00:07
-
-
Save smulube/87579 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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