Module: HealthGraph::Model

Defined Under Namespace

Modules: ClassMethods

Instance Attribute Summary collapse

Attributes included from API

#access_token

Class Method Summary collapse

Instance Method Summary collapse

Methods included from API

#delete, #get, #post, #put

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



5
6
7
# File 'lib/health_graph/model.rb', line 5

def body
  @body
end

Class Method Details

.included(includer) ⇒ Object



7
8
9
# File 'lib/health_graph/model.rb', line 7

def self.included(includer)
  includer.extend ClassMethods          
end

Instance Method Details

#populate_from_hash!(hash) ⇒ Object



28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/health_graph/model.rb', line 28

def populate_from_hash!(hash)
  return unless hash
  
  hash.each do |key, value|
    set_attr_method = "#{key}="
    unless value.nil?
      if respond_to?(set_attr_method)
        self.__send__(set_attr_method, value)
      end
    end
  end
end