Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Example using the stsplatform ruby library.
# Require the stsplatform gem. Make sure to install it
# To install from source run: "bundle exec rake install"
# to install from RubyGems run : "gem install stsplatform"
require 'stsplatform'
# A sensor to use for this example. We will use
SENSOR_NAME = 'calderonroberto.demo'
# First, create a client that will handle all the REST calls
c =
# Create a sensor object, that uses the client:
# Print the sensor object:
res = s.get()
puts res.code
# To acccess data from a sensor create a data object that uses the sensor object
d =
# Print the last data point. Do a get request on the data resource, passing
# a parameter: "beforeE", according to:
res = d.get({beforeE:1})
puts res.code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.