Class: EnotasApi::Entity
- Inherits:
-
Object
- Object
- EnotasApi::Entity
- Includes:
- Attributable
- Defined in:
- lib/enotas_api/common/entity.rb
Direct Known Subclasses
V1::Empresa, V1::EmpresaConfiguracoes, V1::EmpresaEndereco, V1::Nfs, V1::NfsCliente, V1::NfsClienteEndereco, V1::NfsDadosAdicionaisEmail, V1::NfsServico, V2::Empresa, V2::EmpresaConfiguracoes, V2::EmpresaEmissaoNfeProduto, V2::EmpresaEndereco, V2::Nfce, V2::NfceCliente, V2::NfceClienteEndereco, V2::NfceImpostoCofins, V2::NfceImpostoIcms, V2::NfceImpostoIpi, V2::NfceImpostoPercentualAproximadoTributos, V2::NfceImpostoPis, V2::NfceImpostoPorAliquota, V2::NfceImpostoPorValor, V2::NfceImpostoTributosDetalhado, V2::NfceImpostoTributosSimplificado, V2::NfceItem, V2::NfceItemImpostos, V2::NfcePedido, V2::NfcePedidoPagamento, V2::NfcePedidoPagamentoForma, V2::NfcePedidoPagamentoFormaCredenciadora, V2::Nfe, V2::NfeCliente, V2::NfeClienteEndereco, V2::NfeImpostoCofins, V2::NfeImpostoIcms, V2::NfeImpostoIpi, V2::NfeImpostoPercentualAproximadoTributos, V2::NfeImpostoPis, V2::NfeImpostoPorAliquota, V2::NfeImpostoPorValor, V2::NfeImpostoTributosDetalhado, V2::NfeImpostoTributosSimplificado, V2::NfeItem, V2::NfeItemImpostos, V2::NfeReferenciada
Instance Method Summary collapse
Methods included from Attributable
#attribute_changed?, #attribute_type, #attributes, #attributes_changed, included, #initialize, #set
Instance Method Details
#as_json(_options = nil) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/enotas_api/common/entity.rb', line 12 def as_json( = nil) attributes.keys .map { |att| [att, json_value(att)] } .reject { |e| e[1].nil? && !attribute_changed?(e[0]) } .to_h end |
#to_json(options = nil) ⇒ Object
19 20 21 |
# File 'lib/enotas_api/common/entity.rb', line 19 def to_json( = nil) as_json.to_json() end |