Class: HealthGraph::Profile

Inherits:
Object
  • Object
show all
Includes:
Model
Defined in:
lib/health_graph/models/profile.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, path) ⇒ Profile

Returns a new instance of Profile.



7
8
9
10
11
12
# File 'lib/health_graph/models/profile.rb', line 7

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

Instance Method Details

#elite?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/health_graph/models/profile.rb', line 14

def elite?
  self.body["elite"] == "true"
end