Class: Actions

Inherits:
Object
  • Object
show all
Defined in:
lib/startask.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#statusObject

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_sObject



107
108
109
# File 'lib/startask.rb', line 107

def to_s()
  @a.each(&:to_s)
end

#to_xmlObject



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