class MarvelCrawler::ApiClient

Attributes

api_key[RW]
private_key[RW]
record_per_page[RW]

Public Class Methods

new(api_key = nil, pri_key = nil, record_per_page = 5) click to toggle source
# File lib/marvel_crawler/api_client.rb, line 9
def initialize(api_key = nil, pri_key = nil, record_per_page = 5)
  # All calls to the Marvel Comics API must pass your public key via an "apikey" parameter
  @api_key = api_key
  @private_key = pri_key
  @record_per_page = record_per_page
end

Public Instance Methods

configure() { |self| ... } click to toggle source

Customize default settings for the gem using block.

MarvelCrawler::ApiClient.new.configure do |config|
  config.api_key = "xxx"
  config.private_key = "xxx"
end

If no block given, return the default Configuration object.

# File lib/marvel_crawler/api_client.rb, line 22
def configure
  if block_given?
    yield(self)
  else
    self
  end
end