Module: Vindi::Rest::Usage

Included in:
Vindi::Rest
Defined in:
lib/vindi/rest/usage.rb

Overview

Methods for the Usage API

Instance Method Summary collapse

Instance Method Details

#create_usage(options = {}) ⇒ Hash

Create a usage for a merchant vindi

Examples:

Create a usage for a merchant vindi

client.create_usage(period_id: 382, product_item_id: 141,
                    quantity: 3)

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :options (Hash)

    usage attributes

Returns:

  • (Hash)

    The usage created

See Also:



16
17
18
# File 'lib/vindi/rest/usage.rb', line 16

def create_usage(options = {})
  post('usages', options)[:usage]
end

#delete_usage(usage_id, options = {}) ⇒ Object

Delete a usage

Examples:

Delete usage #2

client.delete_usage(2)

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :options (Hash)

    usage attributes

See Also:



27
28
29
# File 'lib/vindi/rest/usage.rb', line 27

def delete_usage(usage_id, options = {})
  delete("usages/#{usage_id}", options)[:usage]
end