Sha256: 7c441bace056245d31e20c1ecd58de54844c52c24d084d1405f24b03cc9036bf

Contents?: true

Size: 580 Bytes

Versions: 8

Compression:

Stored size: 580 Bytes

Contents

module RakutenWebService
  class Configuration
    attr_accessor :application_id, :affiliate_id, :max_retries

    def initialize
      @max_retries = 5
    end

    def generate_parameters
      { :application_id => application_id, :affiliate_id => affiliate_id }
    end
  end

  def configuration(&block)
    @configuration ||= Configuration.new
    if block
      if block.arity != 1
        raise ArgumentError, 'Block is required to have one argument' 
      end
      block.call(@configuration)
    end
    return @configuration
  end

  module_function :configuration
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rakuten_web_service-0.6.3 lib/rakuten_web_service/configuration.rb
rakuten_web_service-0.6.2 lib/rakuten_web_service/configuration.rb
rakuten_web_service-0.6.1 lib/rakuten_web_service/configuration.rb
rakuten_web_service-0.6.0 lib/rakuten_web_service/configuration.rb
rakuten_web_service-0.5.0 lib/rakuten_web_service/configuration.rb
rakuten_web_service-0.4.2 lib/rakuten_web_service/configuration.rb
rakuten_web_service-0.4.1 lib/rakuten_web_service/configuration.rb
rakuten_web_service-0.3.1 lib/rakuten_web_service/configuration.rb