class Loaf::Configuration
Constants
- DEFAULT_LOCALES_PATH
- DEFAULT_MATCH
- VALID_ATTRIBUTES
Public Class Methods
new(attributes = {})
click to toggle source
Setup this configuration
@api public
# File lib/loaf/configuration.rb, line 19 def initialize(attributes = {}) VALID_ATTRIBUTES.each do |attr| default = self.class.const_get("DEFAULT_#{attr.to_s.upcase}") attr_value = attributes.fetch(attr) { default } send("#{attr}=", attr_value) end end
Public Instance Methods
to_hash()
click to toggle source
Convert all properties into hash
@return [Hash]
@api public
# File lib/loaf/configuration.rb, line 32 def to_hash VALID_ATTRIBUTES.reduce({}) { |acc, k| acc[k] = send(k); acc } end