Class: Actions
- Inherits:
-
Object
- Object
- Actions
- Defined in:
- lib/startask.rb
Instance Attribute Summary collapse
-
#status ⇒ Object
Returns the value of attribute status.
Instance Method Summary collapse
- #[](i) ⇒ Object
- #import(a) ⇒ Object
-
#initialize(callback = nil) ⇒ Actions
constructor
A new instance of Actions.
- #to_s ⇒ Object
- #to_xml ⇒ Object
Constructor Details
#initialize(callback = nil) ⇒ Actions
Returns a new instance of Actions.
89 90 91 |
# File 'lib/startask.rb', line 89 def initialize(callback=nil) @callback = callback end |
Instance Attribute Details
#status ⇒ Object
Returns the value of attribute status.
87 88 89 |
# File 'lib/startask.rb', line 87 def status @status end |
Instance Method Details
#[](i) ⇒ Object
103 104 105 |
# File 'lib/startask.rb', line 103 def [](i) @a[i] end |
#import(a) ⇒ Object
93 94 95 96 97 98 99 100 101 |
# File 'lib/startask.rb', line 93 def import(a) @a = a.map do |x| x.is_a?(String) ? ActionItem.new(x, @callback) : Actions.new(@callback).import(x) end return self end |
#to_s ⇒ Object
107 108 109 |
# File 'lib/startask.rb', line 107 def to_s() @a.each(&:to_s) end |
#to_xml ⇒ Object
111 112 113 114 115 |
# File 'lib/startask.rb', line 111 def to_xml() Rexle::Element.new( :actions, value: @a.map(&:to_xml).join) #@a.map(&:to_xml) end |