Class: Vend::Store
Instance Method Summary collapse
-
#get(options) ⇒ Object
Dispatch a request using HTTP GET.
-
#initialize(credentials = {}) ⇒ Store
constructor
A new instance of Store.
-
#post(options) ⇒ Object
Dispatch a request using HTTP POST.
Methods included from HasResources
Constructor Details
#initialize(credentials = {}) ⇒ Store
Returns a new instance of Store.
9 10 11 12 13 14 15 16 17 |
# File 'lib/vend/store.rb', line 9 def initialize(credentials={}) @authenticator = Vend::Config.auth_method case @authenticator when :basic_auth @name, @credentials = credentials[:store_name], [credentials[:username], credentials[:password]] when :oauth @name, @auth_token = credentials[:store_name], credentials[:auth_token] end end |
Instance Method Details
#get(options) ⇒ Object
Dispatch a request using HTTP GET
21 22 23 |
# File 'lib/vend/store.rb', line 21 def get dispatch :get, end |
#post(options) ⇒ Object
Dispatch a request using HTTP POST
27 28 29 |
# File 'lib/vend/store.rb', line 27 def post dispatch :post, end |