Sha256: fe3d6f7d92401610e1564115f3b2f8849b4c7ba9be0b8f3b2696f57602e8f8fd

Contents?: true

Size: 1.2 KB

Versions: 20

Compression:

Stored size: 1.2 KB

Contents

module MagicAddresses
  class Configuration
    OPTIONS = []

    # Address Owners .. all models that use addresses (name + class_name => {users: "User", things: "Namespace::Thing"}) 
    attr_accessor :address_owners

    # Enabled languages .. save address in each if different to default locale
    attr_accessor :active_locales

    # Addresses default locale
    attr_accessor :default_locale

    # Addresses default country
    attr_accessor :default_country
    # add default country in query ?
    attr_accessor :query_defaults

    # only save tranlations when differs from default?
    attr_accessor :uniq_translations

    # Job backend ( :sidekiq | :none )
    attr_accessor :job_backend

    attr_accessor :earthdistance

    def initialize
      @address_owners     = {}
      @active_locales     = [:en, :de]
      @default_locale     = :en
      @default_country    = "Germany"
      @query_defaults     = true
      @uniq_translations  = false
      @job_backend        = :none
      @earthdistance      = false
    end

    # Returns a hash of all configurable options
    def to_hash
      OPTIONS.inject({}) do |hash, option|
        hash.merge(option.to_sym => send(option))
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
magic_addresses-0.0.32 lib/magic_addresses/configuration.rb
magic_addresses-0.0.31 lib/magic_addresses/configuration.rb
magic_addresses-0.0.30 lib/magic_addresses/configuration.rb
magic_addresses-0.0.29 lib/magic_addresses/configuration.rb
magic_addresses-0.0.28 lib/magic_addresses/configuration.rb
magic_addresses-0.0.27 lib/magic_addresses/configuration.rb
magic_addresses-0.0.26 lib/magic_addresses/configuration.rb
magic_addresses-0.0.25 lib/magic_addresses/configuration.rb
magic_addresses-0.0.24 lib/magic_addresses/configuration.rb
magic_addresses-0.0.23 lib/magic_addresses/configuration.rb
magic_addresses-0.0.22 lib/magic_addresses/configuration.rb
magic_addresses-0.0.21 lib/magic_addresses/configuration.rb
magic_addresses-0.0.20 lib/magic_addresses/configuration.rb
magic_addresses-0.0.19 lib/magic_addresses/configuration.rb
magic_addresses-0.0.18 lib/magic_addresses/configuration.rb
magic_addresses-0.0.17 lib/magic_addresses/configuration.rb
magic_addresses-0.0.16 lib/magic_addresses/configuration.rb
magic_addresses-0.0.15 lib/magic_addresses/configuration.rb
magic_addresses-0.0.14 lib/magic_addresses/configuration.rb
magic_addresses-0.0.13 lib/magic_addresses/configuration.rb