Class: LightspeedRestaurantClient::Base
- Inherits:
-
Object
- Object
- LightspeedRestaurantClient::Base
- Defined in:
- lib/lightspeed_restaurant/base.rb
Direct Known Subclasses
Company, Customer, CustomerCreditChange, CustomerLoyaltyCard, Receipt
Instance Method Summary collapse
- #attributes ⇒ Object
-
#initialize(data = {}) ⇒ Base
constructor
A new instance of Base.
- #to_json ⇒ Object
Constructor Details
#initialize(data = {}) ⇒ Base
Returns a new instance of Base.
3 4 5 |
# File 'lib/lightspeed_restaurant/base.rb', line 3 def initialize(data = {}) convert_to_obj(data) end |
Instance Method Details
#attributes ⇒ Object
7 8 9 10 11 |
# File 'lib/lightspeed_restaurant/base.rb', line 7 def attributes instance_variables.each_with_object({}) do |instance_variable, h| h[instance_variable[1..instance_variable.length]] = instance_variable_get(instance_variable) end end |
#to_json ⇒ Object
13 14 15 |
# File 'lib/lightspeed_restaurant/base.rb', line 13 def to_json attributes.to_json end |