Class: Gerint::Alta
Instance Attribute Summary collapse
-
#cidPrincipal ⇒ Object
Returns the value of attribute cidPrincipal.
-
#cpfMedicoAlta ⇒ Object
Returns the value of attribute cpfMedicoAlta.
-
#dataAlta ⇒ Object
Returns the value of attribute dataAlta.
-
#identEncaminhamentoPosAlta ⇒ Object
Returns the value of attribute identEncaminhamentoPosAlta.
-
#identMotivoAlta ⇒ Object
Returns the value of attribute identMotivoAlta.
-
#prescricaoAlta ⇒ Object
Returns the value of attribute prescricaoAlta.
-
#protocoloSolicitacao ⇒ Object
Returns the value of attribute protocoloSolicitacao.
-
#resumoInternacao ⇒ Object
Returns the value of attribute resumoInternacao.
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
#cidPrincipal ⇒ Object
Returns the value of attribute cidPrincipal.
6 7 8 |
# File 'lib/gerint/servicos/alta.rb', line 6 def cidPrincipal @cidPrincipal end |
#cpfMedicoAlta ⇒ Object
Returns the value of attribute cpfMedicoAlta.
5 6 7 |
# File 'lib/gerint/servicos/alta.rb', line 5 def cpfMedicoAlta @cpfMedicoAlta end |
#dataAlta ⇒ Object
Returns the value of attribute dataAlta.
5 6 7 |
# File 'lib/gerint/servicos/alta.rb', line 5 def dataAlta @dataAlta end |
#identEncaminhamentoPosAlta ⇒ Object
Returns the value of attribute identEncaminhamentoPosAlta.
5 6 7 |
# File 'lib/gerint/servicos/alta.rb', line 5 def identEncaminhamentoPosAlta @identEncaminhamentoPosAlta end |
#identMotivoAlta ⇒ Object
Returns the value of attribute identMotivoAlta.
5 6 7 |
# File 'lib/gerint/servicos/alta.rb', line 5 def identMotivoAlta @identMotivoAlta end |
#prescricaoAlta ⇒ Object
Returns the value of attribute prescricaoAlta.
6 7 8 |
# File 'lib/gerint/servicos/alta.rb', line 6 def prescricaoAlta @prescricaoAlta end |
#protocoloSolicitacao ⇒ Object
Returns the value of attribute protocoloSolicitacao.
5 6 7 |
# File 'lib/gerint/servicos/alta.rb', line 5 def protocoloSolicitacao @protocoloSolicitacao end |
#resumoInternacao ⇒ Object
Returns the value of attribute resumoInternacao.
6 7 8 |
# File 'lib/gerint/servicos/alta.rb', line 6 def resumoInternacao @resumoInternacao end |
Instance Method Details
#all_json ⇒ Object
Gera hash com todas as variaveis de instancia
22 23 24 25 26 27 28 29 30 |
# File 'lib/gerint/servicos/alta.rb', line 22 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
8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/gerint/servicos/alta.rb', line 8 def as_json(={}) h = { protocoloSolicitacao: @protocoloSolicitacao, dataAlta: @dataAlta, identMotivoAlta: @identMotivoAlta } h.store(:cpfMedicoAlta, @cpfMedicoAlta) unless @cpfMedicoAlta.nil? h.store(:identEncaminhamentoPosAlta, @identEncaminhamentoPosAlta) unless @identEncaminhamentoPosAlta.nil? h.store(:resumoInternacao, @resumoInternacao) unless @resumoInternacao.nil? h.store(:prescricaoAlta, @prescricaoAlta) unless @prescricaoAlta.nil? h.store(:cidPrincipal, @cidPrincipal) unless @cidPrincipal.nil? h end |
#to_json(*options) ⇒ Object
32 33 34 |
# File 'lib/gerint/servicos/alta.rb', line 32 def to_json(*) as_json(*).to_json(*) end |