Class: Tibber::Client
Overview
Wrapper for the Tibber REST API
Instance Attribute Summary collapse
-
#information ⇒ Object
Returns the value of attribute information.
Instance Method Summary collapse
- #consumption(home_id, resolution, count) ⇒ Object
-
#initialize(options = {}) ⇒ Client
constructor
A new instance of Client.
- #send_push_notification(title, message, screen_to_open) ⇒ Object
Methods inherited from API
Methods included from Authentication
Methods included from Request::GraphQL
Constructor Details
#initialize(options = {}) ⇒ Client
Returns a new instance of Client.
12 13 14 15 16 17 18 |
# File 'lib/tibber/client.rb', line 12 def initialize( = {}) super() login @information = self.info rescue GraphQLError => e raise AuthenticationError.new e end |
Instance Attribute Details
#information ⇒ Object
Returns the value of attribute information.
10 11 12 |
# File 'lib/tibber/client.rb', line 10 def information @information end |
Instance Method Details
#consumption(home_id, resolution, count) ⇒ Object
173 174 175 |
# File 'lib/tibber/client.rb', line 173 def consumption(home_id, resolution, count) _consumption({ id: home_id, resolution: resolution, count: count }) end |
#send_push_notification(title, message, screen_to_open) ⇒ Object
152 153 154 |
# File 'lib/tibber/client.rb', line 152 def send_push_notification(title, , screen_to_open) _send_push_notification({ title: title, message: , screen_to_open: screen_to_open }).sendPushNotification end |