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