Sha256: 67758a570a8b0973b99593f010e9ecb666b5074ddfc21ad68c4a88add7f364ab
Contents?: true
Size: 884 Bytes
Versions: 12
Compression:
Stored size: 884 Bytes
Contents
# -*- encoding : utf-8 -*- require 'rubykassa/configuration' module Rubykassa class ConfigurationError < StandardError class << self def raise_errors_for configuration raise ConfigurationError, "Available modes are :test or :production" unless [:test, :production].include? configuration.mode raise ConfigurationError, "Available http methods are :get or :post" unless [:get, :post].include? configuration.http_method raise ConfigurationError, "Available xml http methods are :get or :post" unless [:get, :post].include? configuration.xml_http_method end end end class Client class << self attr_accessor :configuration def configure self.configuration = Rubykassa::Configuration.new yield self.configuration ConfigurationError.raise_errors_for self.configuration end end end end
Version data entries
12 entries across 12 versions & 1 rubygems