Class: Rakuten::Api
- Inherits:
-
Object
show all
- Defined in:
- lib/rakuten/api.rb,
lib/rakuten/api/etc.rb,
lib/rakuten/api/gora.rb,
lib/rakuten/api/books.rb,
lib/rakuten/api/ichiba.rb,
lib/rakuten/api/recipe.rb,
lib/rakuten/api/travel.rb,
lib/rakuten/api/auction.rb,
lib/rakuten/api/product.rb,
lib/rakuten/api/version.rb,
lib/rakuten/api/bookmark.rb
Defined Under Namespace
Classes: Auction, Bookmark, Books, Etc, Gora, Ichiba, Product, Recipe, Travel
Constant Summary
collapse
- VERSION =
"0.1.3"
- @@options =
{}
Class Method Summary
collapse
Class Method Details
30
31
32
33
|
# File 'lib/rakuten/api.rb', line 30
def configure(&proc)
raise ArgumentError, "Block is required." unless block_given?
yield @@options
end
|
.get(method, opts = {}) ⇒ Object
43
44
45
|
# File 'lib/rakuten/api.rb', line 43
def get(method,opts={})
eval "#{method}(#{opts})"
end
|
.merge(opts = {}) ⇒ Object
35
36
37
38
39
40
41
|
# File 'lib/rakuten/api.rb', line 35
def merge(opts={})
opts.merge!(@@options)
ids = opts[:applicationId].split(",")
opts[:applicationId] = ids[rand(ids.size)]
opts[:developerId] = opts[:applicationId] if opts.key?(:developerId)
opts
end
|
.options ⇒ Object
26
27
28
|
# File 'lib/rakuten/api.rb', line 26
def options
@@options
end
|