Class: STDDAPI::Objects::Customer
- Inherits:
-
Object
- Object
- STDDAPI::Objects::Customer
- Defined in:
- lib/objects.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name) ⇒ Customer
constructor
A new instance of Customer.
- #to_json ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(name) ⇒ Customer
Returns a new instance of Customer.
4 5 6 |
# File 'lib/objects.rb', line 4 def initialize(name) @name = name end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
7 8 9 |
# File 'lib/objects.rb', line 7 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/objects.rb', line 7 def name @name end |
Instance Method Details
#to_json ⇒ Object
11 12 13 |
# File 'lib/objects.rb', line 11 def to_json {'name' => @name}.to_json end |
#to_s ⇒ Object
8 9 10 |
# File 'lib/objects.rb', line 8 def to_s "name: #{@name}, id: #{@id}" end |