class MCFDI::Base

Public Class Methods

attr_accessor(*vars) click to toggle source
Calls superclass method
# File lib/m_cfdi/base.rb, line 3
def self.attr_accessor(*vars)
  @attributes ||= []
  @attributes.concat vars
  super(*vars)
end
attributes() click to toggle source
# File lib/m_cfdi/base.rb, line 9
def self.attributes
  @attributes
end

Public Instance Methods

attributes() click to toggle source

return list of attr_accessors.

# File lib/m_cfdi/base.rb, line 14
def attributes
  self.class.attributes
end
to_h() click to toggle source

return hash of attributes with values.

# File lib/m_cfdi/base.rb, line 19
def to_h
  h = {}
  attributes.each { |k| h[k] = send(k) }
  h
end