Module: Figly::Settings
- Defined in:
- lib/figly/settings.rb
Defined Under Namespace
Modules: SettingsHash
Class Method Summary collapse
Class Method Details
.method_missing(meth, *args, &block) ⇒ Object
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/figly/settings.rb', line 48 def self.method_missing(meth, *args, &block) m = meth == :[] ? args[0] : meth data = Figly.data val = if data.key?(m.to_s) data[m.to_s] elsif data.key?(m.to_sym) data[m.to_sym] end if val.instance_of?(Hash) val.extend(SettingsHash) elsif val.instance_of? Array val.each_with_index{ |item ,idx| item.extend(SettingsHash) if item.instance_of? Hash } end return val end |
.to_h ⇒ Object
44 45 46 |
# File 'lib/figly/settings.rb', line 44 def self.to_h Figly.data end |