helium/helium-ruby

View on GitHub
bin/console

Summary

Maintainability
Test Coverage
#!/usr/bin/env ruby

require "bundler/setup"
require "helium"

class Object
  API_KEY = ENV['HELIUM_API_KEY'].freeze

  def client
    return nil if API_KEY.nil?
    @client ||= Helium::Client.new(api_key: API_KEY, debug: true)
  end

  def sensor
    client.sensor("aba370be-837d-4b41-bee5-686b0069d874")
  end

  def timeseries
    sensor.timeseries(port: 't', start_time: DateTime.parse('2016-08-01'), end_time: DateTime.parse('2016-08-16'))
  end
end

require "pry"
Pry.start