Class: WooCommerce::ApiBase

Inherits:
Object
  • Object
show all
Defined in:
lib/woocommerce_api.rb

Direct Known Subclasses

API

Constant Summary collapse

DEFAULT_ARGS =
{
  wp_api: false,
  version: "v3",
  verify_ssl: true,
  signature_method: "HMAC-SHA256",
  httparty_args: {}
}.freeze

Instance Method Summary collapse

Constructor Details

#initialize(url, consumer_key, consumer_secret, args = {}) ⇒ ApiBase

Returns a new instance of ApiBase.



21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/woocommerce_api.rb', line 21

def initialize(url, consumer_key, consumer_secret, args = {})
  # Required args
  @url = url
  @consumer_key = consumer_key
  @consumer_secret = consumer_secret

  args = DEFAULT_ARGS.merge(args)
  create_args_variables(args)

  # Internal args
  @is_ssl = @url.start_with? "https"
end