Sha256: 69da122ee2265910d0a44638d57a4bc2846e6a9198758c4c3929df8db2774d48

Contents?: true

Size: 538 Bytes

Versions: 9

Compression:

Stored size: 538 Bytes

Contents

module KktShoppe
  class Settings
    
    def initialize(hash)
      @hash = hash
    end
    
    def outbound_email_address
      "#{store_name} <#{email_address}>"
    end
    
    def method_missing(key, _ = nil)
      key = key.to_s.gsub(/\?\z/, '')
      if value = @hash[key.to_s]
        value
      elsif I18n.translate("kkt_shoppe.settings.defaults").keys.include?(key.to_sym)
        I18n.translate("kkt_shoppe.settings.defaults")[key.to_sym]
      end
    end
    
    def [](value)
      @hash[value]
    end
    
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
kkt_shoppe-2.0.2 lib/kkt_shoppe/settings.rb
kkt_shoppe-2.0.1 lib/kkt_shoppe/settings.rb
kkt_shoppe-2.0.0 lib/kkt_shoppe/settings.rb
kkt_shoppe-1.3.0 lib/kkt_shoppe/settings.rb
kkt_shoppe-1.2.1 lib/kkt_shoppe/settings.rb
kkt_shoppe-1.2.0 lib/kkt_shoppe/settings.rb
kkt_shoppe-1.1.2 lib/kkt_shoppe/settings.rb
kkt_shoppe-1.1.1 lib/kkt_shoppe/settings.rb
kkt_shoppe-1.1.0 lib/kkt_shoppe/settings.rb