Module: BrNfe::Association::HaveDestinatario
- Included in:
- Service::Response::NotaFiscal, Service::Rps
- Defined in:
- lib/br_nfe/association/have_destinatario.rb
Instance Method Summary collapse
Instance Method Details
#destinatario {|destinatario| ... } ⇒ Object
4 5 6 7 |
# File 'lib/br_nfe/association/have_destinatario.rb', line 4 def destinatario yield(destinatario) if block_given? @destinatario.is_a?(destinatario_class) ? @destinatario : @destinatario = destinatario_class.new() end |
#destinatario=(value) ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/br_nfe/association/have_destinatario.rb', line 9 def destinatario=(value) if value.is_a?(destinatario_class) || value.nil? @destinatario = value elsif value.is_a?(Hash) destinatario.assign_attributes(value) end end |