Class: HealthGraph::User
- Inherits:
-
Object
show all
- Includes:
- Model
- Defined in:
- lib/health_graph/models/user.rb
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) ⇒ User
Returns a new instance of User.
7
8
9
10
11
12
|
# File 'lib/health_graph/models/user.rb', line 7
def initialize(access_token)
self.access_token = access_token
response = get "user", HealthGraph.[:user]
self.body = response.body
populate_from_hash! self.body
end
|
Instance Method Details
#fitness_activities(params = {}) ⇒ Object
30
31
32
|
# File 'lib/health_graph/models/user.rb', line 30
def fitness_activities params = {}
HealthGraph::FitnessActivitiesFeed.new self.access_token, self.body["fitness_activities"], params
end
|
#fitness_activity_delete(params) ⇒ Object
#fitness_activity_update(params) ⇒ Object
#new_fitness_activity(params) ⇒ Object
#profile ⇒ Object
14
15
16
|
# File 'lib/health_graph/models/user.rb', line 14
def profile
HealthGraph::Profile.new self.access_token, self.body["profile"]
end
|
#settings ⇒ Object
18
19
20
|
# File 'lib/health_graph/models/user.rb', line 18
def settings
HealthGraph::Settings.new self.access_token, self.body["settings"]
end
|
#sleep ⇒ Object
26
27
28
|
# File 'lib/health_graph/models/user.rb', line 26
def sleep
HealthGraph::SleepFeed.new self.access_token, self.body["sleep"]
end
|
#strength_training_activities(params = {}) ⇒ Object
46
47
48
|
# File 'lib/health_graph/models/user.rb', line 46
def strength_training_activities params = {}
HealthGraph::StrengthTrainingActivitiesFeed.new self.access_token, self.body["strength_training_activities"], params
end
|
#weight ⇒ Object
22
23
24
|
# File 'lib/health_graph/models/user.rb', line 22
def weight
HealthGraph::WeightFeed.new self.access_token, self.body["weight"]
end
|