Sha256: 88c1fead3e610f168a19a539bbe8e001bf853fe8361e7d8f4d363a29e3f9f1d2

Contents?: true

Size: 1020 Bytes

Versions: 6

Compression:

Stored size: 1020 Bytes

Contents

module Avo
  class Configuration
    attr_accessor :root_path
    attr_accessor :app_name
    attr_accessor :timezone
    attr_accessor :per_page
    attr_accessor :per_page_steps
    attr_accessor :via_per_page
    attr_accessor :locale
    attr_accessor :currency
    attr_accessor :default_view_type
    attr_accessor :hide_resource_overview_component
    attr_accessor :hide_documentation_link

    def initialize
      @root_path = '/avo'
      @app_name = Rails.application.class.to_s.split('::').first.underscore.humanize
      @timezone = 'UTC'
      @per_page = 24
      @per_page_steps = [12, 24, 48, 72]
      @via_per_page = 8
      @locale = 'us-US'
      @currency = 'USD'
      @default_view_type = :table
      @hide_resource_overview_component = false
      @hide_documentation_link = false
    end
  end

  def self.configuration
    @configuration ||= Configuration.new
  end

  def self.configuration=(config)
    @configuration = config
  end

  def self.configure
    yield configuration
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
avo-0.2.5 lib/avo/configuration.rb
avo-0.2.4 lib/avo/configuration.rb
avo-0.2.3 lib/avo/configuration.rb
avo-0.2.2 lib/avo/configuration.rb
avo-0.2.1 lib/avo/configuration.rb
avo-0.2.0 lib/avo/configuration.rb