Class: MCFDI::Entity
Overview
Entity Class for transmitter and receptor
Instance Attribute Summary collapse
-
#address ⇒ Object
Returns the value of attribute address.
-
#business_name ⇒ Object
Returns the value of attribute business_name.
-
#fiscal_regime ⇒ Object
Returns the value of attribute fiscal_regime.
-
#issued_in ⇒ Object
Returns the value of attribute issued_in.
-
#rfc ⇒ Object
Returns the value of attribute rfc.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ Entity
constructor
A new instance of Entity.
-
#original_string ⇒ Object
return original string without fiscal regime.
-
#to_x ⇒ Object
return hash with values for invoice xml.
Methods inherited from Base
attr_accessor, attributes, #attributes, #to_h
Constructor Details
#initialize(args = {}) ⇒ Entity
Returns a new instance of Entity.
12 13 14 |
# File 'lib/m_cfdi/entity.rb', line 12 def initialize(args = {}) args.each { |key, value| send("#{key}=", value) } end |
Instance Attribute Details
#address ⇒ Object
Returns the value of attribute address.
10 11 12 |
# File 'lib/m_cfdi/entity.rb', line 10 def address @address end |
#business_name ⇒ Object
Returns the value of attribute business_name.
10 11 12 |
# File 'lib/m_cfdi/entity.rb', line 10 def business_name @business_name end |
#fiscal_regime ⇒ Object
Returns the value of attribute fiscal_regime.
10 11 12 |
# File 'lib/m_cfdi/entity.rb', line 10 def fiscal_regime @fiscal_regime end |
#issued_in ⇒ Object
Returns the value of attribute issued_in.
10 11 12 |
# File 'lib/m_cfdi/entity.rb', line 10 def issued_in @issued_in end |
#rfc ⇒ Object
Returns the value of attribute rfc.
10 11 12 |
# File 'lib/m_cfdi/entity.rb', line 10 def rfc @rfc end |
Instance Method Details
#original_string ⇒ Object
return original string without fiscal regime.
36 37 38 39 40 41 |
# File 'lib/m_cfdi/entity.rb', line 36 def original_string issued = @issued_in ? @issued_in.original_string : nil co = [@rfc, @business_name, @address.original_string] co.insert(3, issued) if issued co.flatten end |
#to_x ⇒ Object
return hash with values for invoice xml.
31 32 33 |
# File 'lib/m_cfdi/entity.rb', line 31 def to_x { nombre: @business_name, rfc: @rfc } end |