Class: HealthGraph::SleepFeed

Inherits:
Object
  • Object
show all
Includes:
Model
Defined in:
lib/health_graph/models/sleep_feed.rb

Defined Under Namespace

Classes: Item

Instance Attribute Summary

Attributes included from Model

#body

Attributes included from API

#access_token

Instance Method Summary collapse

Methods included from Model

included, #populate_from_hash!

Methods included from API

#delete, #get, #post, #put

Constructor Details

#initialize(access_token, path) ⇒ SleepFeed

Returns a new instance of SleepFeed.



17
18
19
20
21
22
# File 'lib/health_graph/models/sleep_feed.rb', line 17

def initialize(access_token, path)            
  self.access_token = access_token
  response = get path, HealthGraph.accept_headers[:sleep_feed]
  self.body = response.body
  populate_from_hash! self.body                  
end