Class: KondutoSeller
- Inherits:
-
Object
- Object
- KondutoSeller
- Defined in:
- lib/konduto-ruby/konduto_seller.rb
Instance Attribute Summary collapse
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(*args) ⇒ KondutoSeller
constructor
A new instance of KondutoSeller.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(*args) ⇒ KondutoSeller
Returns a new instance of KondutoSeller.
4 5 6 7 8 9 10 |
# File 'lib/konduto-ruby/konduto_seller.rb', line 4 def initialize(*args) unless args[0].nil? args[0].each do |k,v| instance_variable_set("@#{k}", v) unless v.nil? end end end |
Instance Attribute Details
#created_at ⇒ Object
Returns the value of attribute created_at.
2 3 4 |
# File 'lib/konduto-ruby/konduto_seller.rb', line 2 def created_at @created_at end |
#id ⇒ Object
Returns the value of attribute id.
2 3 4 |
# File 'lib/konduto-ruby/konduto_seller.rb', line 2 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
2 3 4 |
# File 'lib/konduto-ruby/konduto_seller.rb', line 2 def name @name end |
Instance Method Details
#to_hash ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/konduto-ruby/konduto_seller.rb', line 12 def to_hash hash = { id: self.id, name: self.name, created_at: self.created_at } KondutoUtils.remove_nil_keys_from_hash(hash) end |
#to_json ⇒ Object
21 22 23 |
# File 'lib/konduto-ruby/konduto_seller.rb', line 21 def to_json self.to_hash.to_json end |