Class: Taskr::Models::TaskActionParameter

Inherits:
Base
  • Object
show all
Defined in:
lib/taskr/models.rb

Instance Method Summary collapse

Instance Method Details

#to_sObject



224
225
226
# File 'lib/taskr/models.rb', line 224

def to_s
  "#{self.class.name.demodulize}(#{name}:#{value})"
end

#to_xml(options = {}) ⇒ Object



211
212
213
214
215
216
217
218
219
220
221
222
# File 'lib/taskr/models.rb', line 211

def to_xml(options = {})
  options[:indent] ||= 2
  xml = options[:builder] ||= Builder::XmlMarkup.new(:indent => options[:indent])
  xml.instruct! unless options[:skip_instruct]
  xml.tag!('action-parameter', :type => self.class) do
    xml.tag!('id', {:type => 'integer'}, id)
    xml.tag!('name', name)
    xml.tag!('value') do
      xml.cdata!(value.to_s)
    end
  end
end