Class: EncomendaStatus

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#dataObject

Returns the value of attribute data.



4
5
6
# File 'lib/encomenda_status.rb', line 4

def data
  @data
end

#detalhesObject

Returns the value of attribute detalhes.



4
5
6
# File 'lib/encomenda_status.rb', line 4

def detalhes
  @detalhes
end

#localObject

Returns the value of attribute local.



4
5
6
# File 'lib/encomenda_status.rb', line 4

def local
  @local
end

#situacaoObject

Returns the value of attribute situacao.



4
5
6
# File 'lib/encomenda_status.rb', line 4

def situacao
  @situacao
end

Instance Method Details

#to_sObject



6
7
8
# File 'lib/encomenda_status.rb', line 6

def to_s
  return "#{super.to_s} {data=>#{@data}, local=>#{@local}, situacao=>#{@situacao}, detalhes=>#{@detalhes}}"
end

#to_xmlObject

TODO: refactor - nao sei se deveria estar aqui…



11
12
13
14
15
16
17
# File 'lib/encomenda_status.rb', line 11

def to_xml
  xml = "<status data=\"#{@data.to_s}\">"
  xml += "<local>#{@local}</local>"
  xml += "<situacao>#{@situacao}</situacao>"
  xml += "<detalhes>#{@detalhes}</detalhes>"
  xml += "</status>"
end