class MfCloud::Invoice::Model::Base
Public Class Methods
attribute_keys()
click to toggle source
# File lib/mf_cloud/invoice/model/base.rb, line 6 def attribute_keys @attribute_keys ||= [] end
new(params)
click to toggle source
# File lib/mf_cloud/invoice/model/base.rb, line 18 def initialize(params) set_attributes(params) end
Private Class Methods
resource_attributes(*attributes)
click to toggle source
# File lib/mf_cloud/invoice/model/base.rb, line 12 def resource_attributes(*attributes) attributes.each { |attribute| attr_accessor attribute } attribute_keys.concat(attributes) end
Private Instance Methods
set_attributes(params)
click to toggle source
# File lib/mf_cloud/invoice/model/base.rb, line 24 def set_attributes(params) self.class.attribute_keys.each do |attr| __send__("#{attr}=", params[attr.to_s]) unless params[attr.to_s].nil? end end