Module: Teamweek::Api::HashConstructed

Included in:
Project, Task, User
Defined in:
lib/teamweek/api/hash_constructed.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#raw_dataObject

Returns the value of attribute raw_data.



4
5
6
# File 'lib/teamweek/api/hash_constructed.rb', line 4

def raw_data
  @raw_data
end

Instance Method Details

#initialize(h) ⇒ Object

initalizes the object by pulling key-value pairs from the hash and mapping them to the object’s instance variables

Parameters:

  • h (Hash)

    hash containing key-value pairs to map to object instance variables



9
10
11
12
# File 'lib/teamweek/api/hash_constructed.rb', line 9

def initialize(h)
  @raw_data = h
  h.each { |k,v| send("#{k}=",v) if respond_to?("#{k}=") }
end