Sha256: e3f7b2f7525cbc768616224c1d7730db8d15ecd1fb7ea336a8fb40fccf75dadd

Contents?: true

Size: 1.07 KB

Versions: 1

Compression:

Stored size: 1.07 KB

Contents

require "naf/engine"
require 'naf/configuration'

module Naf
  class << self
    attr_writer :configuration

    def configure
      yield(configuration)
    end

    def configuration
      @configuration ||= Configuration.new
    end

    def schema_name
      configuration.schema_name
    end

    def model_class
      configuration.model_class.constantize
    end

    def title
      configuration.title
    end

    def layout
      configuration.layout
    end

    def ui_controller_class
      configuration.ui_controller_class.constantize
    end

    def api_controller_class
      configuration.api_controller_class.constantize
    end

    def api_domain_cookie_name
      configuration.api_domain_cookie_name
    end

    def simple_cluster_authenticator_cookie_expiration_time
      configuration.simple_cluster_authenticator_cookie_expiration_time
    end

    def metric_tags
      configuration.metric_tags
    end

    def metric_send_delay
      configuration.metric_send_delay
    end

    def using_another_database?
      model_class != ActiveRecord::Base
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
naf-2.1.13 lib/naf.rb