Class: Shoppe::Settings
- Inherits:
-
Object
show all
- Defined in:
- lib/shoppe/settings.rb
Instance Method Summary
collapse
Constructor Details
#initialize(hash) ⇒ Settings
Returns a new instance of Settings.
4
5
6
|
# File 'lib/shoppe/settings.rb', line 4
def initialize(hash)
@hash = hash
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(key, _ = nil) ⇒ Object
12
13
14
15
16
17
18
19
|
# File 'lib/shoppe/settings.rb', line 12
def method_missing(key, _ = nil)
key = key.to_s.gsub(/\?\z/, '')
if value = @hash[key.to_s]
value
elsif I18n.translate("shoppe.settings.defaults").keys.include?(key.to_sym)
I18n.translate("shoppe.settings.defaults")[key.to_sym]
end
end
|
Instance Method Details
#[](value) ⇒ Object
21
22
23
|
# File 'lib/shoppe/settings.rb', line 21
def [](value)
@hash[value]
end
|
#outbound_email_address ⇒ Object
8
9
10
|
# File 'lib/shoppe/settings.rb', line 8
def outbound_email_address
"#{store_name} <#{email_address}>"
end
|