Module: LoyverseApi::Endpoints::Modifiers
- Included in:
- Client
- Defined in:
- lib/loyverse_api/endpoints/modifiers.rb
Instance Method Summary collapse
-
#create_modifier(name:, options:) ⇒ Hash
Create a new modifier.
-
#delete_modifier(modifier_id) ⇒ Hash
Delete a modifier.
-
#get_modifier(modifier_id) ⇒ Hash
Get a specific modifier by ID.
-
#list_modifiers(limit: 250, cursor: nil, updated_at_min: nil, updated_at_max: nil) ⇒ Hash
List modifiers.
Instance Method Details
#create_modifier(name:, options:) ⇒ Hash
Create a new modifier
34 35 36 37 38 39 40 41 |
# File 'lib/loyverse_api/endpoints/modifiers.rb', line 34 def create_modifier(name:, options:) body = { name: name, options: } post("modifiers", body: body) end |
#delete_modifier(modifier_id) ⇒ Hash
Delete a modifier
46 47 48 |
# File 'lib/loyverse_api/endpoints/modifiers.rb', line 46 def delete_modifier(modifier_id) delete("modifiers/#{modifier_id}") end |
#get_modifier(modifier_id) ⇒ Hash
Get a specific modifier by ID
9 10 11 |
# File 'lib/loyverse_api/endpoints/modifiers.rb', line 9 def get_modifier(modifier_id) get("modifiers/#{modifier_id}") end |
#list_modifiers(limit: 250, cursor: nil, updated_at_min: nil, updated_at_max: nil) ⇒ Hash
List modifiers
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/loyverse_api/endpoints/modifiers.rb', line 19 def list_modifiers(limit: 250, cursor: nil, updated_at_min: nil, updated_at_max: nil) params = { limit: limit, cursor: cursor, updated_at_min: format_time(updated_at_min), updated_at_max: format_time(updated_at_max) }.compact get("modifiers", params: params) end |