Class: Gerint::ReversaoAlta
- Defined in:
- lib/gerint/servicos/reversao_alta.rb
Instance Attribute Summary collapse
-
#codTipoLeito ⇒ Object
Returns the value of attribute codTipoLeito.
-
#identificacaoLeito ⇒ Object
Returns the value of attribute identificacaoLeito.
-
#leitoExtra ⇒ Object
Returns the value of attribute leitoExtra.
-
#protocoloSolicitacao ⇒ Object
Returns the value of attribute protocoloSolicitacao.
Instance Method Summary collapse
-
#all_json ⇒ Object
Gera hash com todas as variaveis de instancia.
- #as_json(options = {}) ⇒ Object
- #to_json(*options) ⇒ Object
Methods inherited from Padrao
Instance Attribute Details
#codTipoLeito ⇒ Object
Returns the value of attribute codTipoLeito.
5 6 7 |
# File 'lib/gerint/servicos/reversao_alta.rb', line 5 def codTipoLeito @codTipoLeito end |
#identificacaoLeito ⇒ Object
Returns the value of attribute identificacaoLeito.
5 6 7 |
# File 'lib/gerint/servicos/reversao_alta.rb', line 5 def identificacaoLeito @identificacaoLeito end |
#leitoExtra ⇒ Object
Returns the value of attribute leitoExtra.
5 6 7 |
# File 'lib/gerint/servicos/reversao_alta.rb', line 5 def leitoExtra @leitoExtra end |
#protocoloSolicitacao ⇒ Object
Returns the value of attribute protocoloSolicitacao.
5 6 7 |
# File 'lib/gerint/servicos/reversao_alta.rb', line 5 def protocoloSolicitacao @protocoloSolicitacao end |
Instance Method Details
#all_json ⇒ Object
Gera hash com todas as variaveis de instancia
18 19 20 21 22 23 24 25 26 |
# File 'lib/gerint/servicos/reversao_alta.rb', line 18 def all_json # Gera hash com todas as variaveis de instancia vinstancia = self.instance_variables h = {} vinstancia.each do |v| h.store(v[1..50], "#{v}") # BUG: v contem o nome da variavel e não o valor int end h h.to_json end |
#as_json(options = {}) ⇒ Object
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/gerint/servicos/reversao_alta.rb', line 7 def as_json(={}) h = { protocoloSolicitacao: @protocoloSolicitacao, identificacaoLeito: @identificacaoLeito, codTipoLeito: @codTipoLeito, } h.store(:leitoExtra, @leitoExtra) unless @leitoExtra.nil? h end |
#to_json(*options) ⇒ Object
28 29 30 |
# File 'lib/gerint/servicos/reversao_alta.rb', line 28 def to_json(*) as_json(*).to_json(*) end |