Module: NetSuite::Support::Attributes
Instance Method Summary collapse
- #attributes ⇒ Object
- #attributes=(attributes) ⇒ Object
- #initialize_from_attributes_hash(attributes = {}) ⇒ Object
Instance Method Details
#attributes ⇒ Object
5 6 7 |
# File 'lib/netsuite/support/attributes.rb', line 5 def attributes @attributes ||= {} end |
#attributes=(attributes) ⇒ Object
9 10 11 |
# File 'lib/netsuite/support/attributes.rb', line 9 def attributes=(attributes) @attributes = attributes end |
#initialize_from_attributes_hash(attributes = {}) ⇒ Object
13 14 15 16 17 18 |
# File 'lib/netsuite/support/attributes.rb', line 13 def initialize_from_attributes_hash(attributes = {}) attributes.select { |k,v| self.class.fields.include?(k) }.each do |k,v| send("#{k}=", v) end self.klass = attributes[:class] if attributes[:class] end |