Class: IActionable::Objects::ProfileGoals

Inherits:
IActionableObject show all
Defined in:
lib/iactionable/objects/profile_goals.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from IActionableObject

timestamp_regexp, timestamp_to_seconds

Constructor Details

#initialize(key_values = {}) ⇒ ProfileGoals

Returns a new instance of ProfileGoals.



7
8
9
10
# File 'lib/iactionable/objects/profile_goals.rb', line 7

def initialize(key_values={})
  @available = extract_many_as(key_values, "Available", IActionable::Objects::Goal)
  @completed = extract_many_as(key_values, "Completed", IActionable::Objects::Goal)
end

Instance Attribute Details

#availableObject

Returns the value of attribute available.



4
5
6
# File 'lib/iactionable/objects/profile_goals.rb', line 4

def available
  @available
end

#completedObject

Returns the value of attribute completed.



5
6
7
# File 'lib/iactionable/objects/profile_goals.rb', line 5

def completed
  @completed
end

Instance Method Details

#to_hashObject



12
13
14
15
16
17
# File 'lib/iactionable/objects/profile_goals.rb', line 12

def to_hash
  {
    "Available" => @available.map{|goal| goal.to_hash},
    "Completed" => @completed.map{|goal| goal.to_hash}
  }
end