class ApiMaker::Configuration

Attributes

profiling[RW]
react_native_path[RW]
threadding[RW]

Public Class Methods

configure() { |current| ... } click to toggle source
# File lib/api_maker/configuration.rb, line 8
def self.configure
  yield ApiMaker::Configuration.current
end
current() click to toggle source
# File lib/api_maker/configuration.rb, line 4
def self.current
  @current ||= ApiMaker::Configuration.new
end
new() click to toggle source
# File lib/api_maker/configuration.rb, line 20
def initialize
  @on_error = []
  @threadding = true
end
profile(name) { || ... } click to toggle source
# File lib/api_maker/configuration.rb, line 12
def self.profile(name, &blk)
  if ApiMaker::Configuration.current.profiling
    Rack::MiniProfiler.step("AM #{name}", &blk)
  else
    yield
  end
end

Public Instance Methods

on_error(&blk) click to toggle source
# File lib/api_maker/configuration.rb, line 25
def on_error(&blk)
  @on_error << blk
end
report_error(error) click to toggle source
# File lib/api_maker/configuration.rb, line 29
def report_error(error)
  @on_error.each do |on_error|
    on_error.call(error)
  end
end