Class: Gerint::TransferirLeito
- Defined in:
- lib/gerint/servicos/transferir_leito.rb
Instance Attribute Summary collapse
-
#codTipoLeito ⇒ Object
Returns the value of attribute codTipoLeito.
-
#identificacaoLeito ⇒ Object
Returns the value of attribute identificacaoLeito.
-
#justifTransferencia ⇒ Object
Returns the value of attribute justifTransferencia.
-
#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/transferir_leito.rb', line 5 def codTipoLeito @codTipoLeito end |
#identificacaoLeito ⇒ Object
Returns the value of attribute identificacaoLeito.
5 6 7 |
# File 'lib/gerint/servicos/transferir_leito.rb', line 5 def identificacaoLeito @identificacaoLeito end |
#justifTransferencia ⇒ Object
Returns the value of attribute justifTransferencia.
5 6 7 |
# File 'lib/gerint/servicos/transferir_leito.rb', line 5 def justifTransferencia @justifTransferencia end |
#leitoExtra ⇒ Object
Returns the value of attribute leitoExtra.
5 6 7 |
# File 'lib/gerint/servicos/transferir_leito.rb', line 5 def leitoExtra @leitoExtra end |
#protocoloSolicitacao ⇒ Object
Returns the value of attribute protocoloSolicitacao.
5 6 7 |
# File 'lib/gerint/servicos/transferir_leito.rb', line 5 def protocoloSolicitacao @protocoloSolicitacao end |
Instance Method Details
#all_json ⇒ Object
Gera hash com todas as variaveis de instancia
19 20 21 22 23 24 25 26 27 |
# File 'lib/gerint/servicos/transferir_leito.rb', line 19 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 17 |
# File 'lib/gerint/servicos/transferir_leito.rb', line 7 def as_json(={}) h = { protocoloSolicitacao: @protocoloSolicitacao, identificacaoLeito: @identificacaoLeito, codTipoLeito: @codTipoLeito, } h.store(:justifTransferencia , @justifTransferencia) unless @justifTransferencia.nil? h.store(:leitoExtra, @leitoExtra) unless @leitoExtra.nil? h end |
#to_json(*options) ⇒ Object
29 30 31 |
# File 'lib/gerint/servicos/transferir_leito.rb', line 29 def to_json(*) as_json(*).to_json(*) end |