Class: BlommingApi::Client

Inherits:
Object
  • Object
show all
Includes:
BuyEndpoints, Config, OauthEndpoint, PrivateHelpers, PublicHelpers, SellEndpoints
Defined in:
lib/blomming_api.rb

Overview

CLIENT ACCESS LOGIC

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from PublicHelpers

#all_pages, collect_key_values, #dump_pretty, id_from_name, #puts_response_header

Methods included from SellEndpoints

#sell_payment_types_create, #sell_payment_types_delete, #sell_payment_types_find, #sell_payment_types_update, #sell_register, #sell_shipping_countries_all, #sell_shipping_profile_create, #sell_shipping_profile_delete, #sell_shipping_profile_find, #sell_shipping_profile_item_create, #sell_shipping_profile_update, #sell_shipping_profiles, #sell_shipping_regions, #sell_shop_dashboard, #sell_shop_item_create, #sell_shop_item_delete, #sell_shop_item_find, #sell_shop_item_tags_add, #sell_shop_item_tags_remove, #sell_shop_item_update, #sell_shop_items, #sell_shop_orders, #sell_shop_orders_change_state, #sell_shop_orders_find, #sell_shop_orders_request_cancellation, #sell_shop_orders_states, #sell_shop_shipping_profiles, #sell_shop_user_details

Methods included from BuyEndpoints

#carts_add, #carts_checkout, #carts_clear, #carts_create, #carts_place_paypal_order, #carts_remove, #carts_shipping_countries, #carts_show, #carts_validate, #categories, #category_items, #collection_items, #collections, #countries, #currencies, #items_discounted, #items_featured, #items_hand_picked, #items_list, #items_most_liked, #items_search, #macrocategories, #macrocategory_categories, #macrocategory_items, #password_resets, #provinces, #shop_item, #shop_items, #shops, #shops_find, #tags, #tags_items

Methods included from OauthEndpoint

#authentication_details

Methods included from PrivateHelpers

#api_url, #authenticate_refresh, #fatal_error!, #feed_or_retry, #http_status_code_401?, #http_status_code_4xx?, #http_status_code_5xx?, #request_params, #server_error!, #socket_error!, #unknown_error!

Methods included from Config

#config_properties

Constructor Details

#initialize(config_filename) ⇒ Client

new



54
55
56
57
58
59
60
# File 'lib/blomming_api.rb', line 54

def initialize(config_filename)
  # read YAML configuration file
  read_config_file config_filename  

  # authenticate client when a new client is created
  authenticate :initialize
end

Instance Attribute Details

#access_tokenObject (readonly)

Returns the value of attribute access_token.



39
40
41
# File 'lib/blomming_api.rb', line 39

def access_token
  @access_token
end

#api_versionObject (readonly)

Returns the value of attribute api_version.



38
39
40
# File 'lib/blomming_api.rb', line 38

def api_version
  @api_version
end

#client_idObject (readonly)

Returns the value of attribute client_id.



37
38
39
# File 'lib/blomming_api.rb', line 37

def client_id
  @client_id
end

#client_secretObject (readonly)

Returns the value of attribute client_secret.



37
38
39
# File 'lib/blomming_api.rb', line 37

def client_secret
  @client_secret
end

#currencyObject

instance variables, read/write



42
43
44
# File 'lib/blomming_api.rb', line 42

def currency
  @currency
end

#descriptionObject (readonly)

instance variables, read-only



35
36
37
# File 'lib/blomming_api.rb', line 35

def description
  @description
end

#domainObject (readonly)

Returns the value of attribute domain.



38
39
40
# File 'lib/blomming_api.rb', line 38

def domain
  @domain
end

#expires_inObject (readonly)

Returns the value of attribute expires_in.



39
40
41
# File 'lib/blomming_api.rb', line 39

def expires_in
  @expires_in
end

#grant_typeObject (readonly)

Returns the value of attribute grant_type.



36
37
38
# File 'lib/blomming_api.rb', line 36

def grant_type
  @grant_type
end

#localeObject

instance variables, read/write



42
43
44
# File 'lib/blomming_api.rb', line 42

def locale
  @locale
end

#passwordObject (readonly)

Returns the value of attribute password.



37
38
39
# File 'lib/blomming_api.rb', line 37

def password
  @password
end

#refresh_tokenObject (readonly)

Returns the value of attribute refresh_token.



39
40
41
# File 'lib/blomming_api.rb', line 39

def refresh_token
  @refresh_token
end

#retry_secondsObject (readonly)

integer: number of seconds between a call and the successive in case of a retry of an API call



47
48
49
# File 'lib/blomming_api.rb', line 47

def retry_seconds
  @retry_seconds
end

#servicesObject (readonly)

Returns the value of attribute services.



36
37
38
# File 'lib/blomming_api.rb', line 36

def services
  @services
end

#survive_on_fatal_errorObject (readonly)

boolean: if false, in case of exceptions, process die with exit



51
52
53
# File 'lib/blomming_api.rb', line 51

def survive_on_fatal_error
  @survive_on_fatal_error
end

#token_typeObject (readonly)

Returns the value of attribute token_type.



39
40
41
# File 'lib/blomming_api.rb', line 39

def token_type
  @token_type
end

#usernameObject (readonly)

Returns the value of attribute username.



37
38
39
# File 'lib/blomming_api.rb', line 37

def username
  @username
end

#verboseObject

instance variables, read/write



42
43
44
# File 'lib/blomming_api.rb', line 42

def verbose
  @verbose
end