Class: HealthGraph::Settings

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

Returns a new instance of Settings.



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

def initialize(access_token, path)            
  self.access_token = access_token
  response = get path, HealthGraph.accept_headers[:settings]
  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/settings.rb', line 14

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