Class: LightspeedRestaurantClient::Base
- Inherits:
-
Object
- Object
- LightspeedRestaurantClient::Base
- Defined in:
- lib/lightspeed_restaurant/base.rb
Direct Known Subclasses
Company, Customer, CustomerCreditChange, CustomerEstablishmentOrder, CustomerLoyaltyCard, PaymentType, ProductGroup, ProductGroupProduct, 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.
5 6 7 |
# File 'lib/lightspeed_restaurant/base.rb', line 5 def initialize(data = {}) convert_to_obj(data) end |
Instance Method Details
#attributes ⇒ Object
9 10 11 12 13 |
# File 'lib/lightspeed_restaurant/base.rb', line 9 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
15 16 17 |
# File 'lib/lightspeed_restaurant/base.rb', line 15 def to_json attributes.to_json end |