class MockChargebee::RequestHandlers::Base

Attributes

env[R]
http_method[R]
params[R]
parsed_path[R]

Public Class Methods

call(http_method, parsed_path, params = {}) click to toggle source
# File lib/mock_chargebee/request_handlers/base.rb, line 6
def self.call(http_method, parsed_path, params = {})
  new(http_method, parsed_path, params).call
end
new(http_method, parsed_path, params) click to toggle source
# File lib/mock_chargebee/request_handlers/base.rb, line 10
def initialize(http_method, parsed_path, params)
  @http_method = http_method
  @parsed_path = parsed_path
  @params = params
  @env = MockChargebee.environment
end

Private Class Methods

load_fixtures(*args) click to toggle source
# File lib/mock_chargebee/request_handlers/base.rb, line 27
def self.load_fixtures(*args)
  args.each do |arg|
    define_method("#{arg}_fixture") do
      instance_variable_get("@#{arg}_fixture") ||
        instance_variable_set("@#{arg}_fixture", JSON.parse(File.read("#{File.dirname(__FILE__)}/../fixtures/#{arg}.json")))
    end
  end
end

Public Instance Methods

call() click to toggle source
# File lib/mock_chargebee/request_handlers/base.rb, line 17
def call
  send("#{http_method}#{sub_command}")
end