Class: ATM::Taskseries
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#list ⇒ Object
readonly
Returns the value of attribute list.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#tasks ⇒ Object
readonly
Returns the value of attribute tasks.
Class Method Summary collapse
Instance Method Summary collapse
- #delete! ⇒ Object
-
#initialize(obj) ⇒ Taskseries
constructor
A new instance of Taskseries.
- #load_values(obj) ⇒ Object
- #save! ⇒ Object
Constructor Details
#initialize(obj) ⇒ Taskseries
Returns a new instance of Taskseries.
13 14 15 |
# File 'lib/atm/taskseries.rb', line 13 def initialize(obj) load_values obj end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
5 6 7 |
# File 'lib/atm/taskseries.rb', line 5 def id @id end |
#list ⇒ Object (readonly)
Returns the value of attribute list.
5 6 7 |
# File 'lib/atm/taskseries.rb', line 5 def list @list end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/atm/taskseries.rb', line 5 def name @name end |
#tasks ⇒ Object (readonly)
Returns the value of attribute tasks.
5 6 7 |
# File 'lib/atm/taskseries.rb', line 5 def tasks @tasks end |
Class Method Details
.all ⇒ Object
7 8 9 10 11 |
# File 'lib/atm/taskseries.rb', line 7 def Taskseries.all List.all.inject([]) do |array, list| array.concat list.taskseries end end |
Instance Method Details
#delete! ⇒ Object
39 40 41 42 43 |
# File 'lib/atm/taskseries.rb', line 39 def delete! tasks.each do |task| task.delete! end end |
#load_values(obj) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/atm/taskseries.rb', line 17 def load_values(obj) obj = Hashie::Mash.new obj @id = obj.id @list = obj.list @name = obj.name @taskseries_id = obj.id @tasks = (obj.task || obj.tasks).in_array.map do |task| task.taskseries = self Task.new task end end |