Class: Devlog::Settings

Inherits:
Hash
  • Object
show all
Defined in:
lib/devlog_settings.rb

Overview

Settings - keeping it simple. Allow settings.key besides settings If the method name exists as a key within this Hash, fetch it.

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(m, *args, &block) ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'lib/devlog_settings.rb', line 11

def method_missing(m, *args, &block)
  if key?(m)
    fetch m
  elsif key?(m.to_s)
    fetch m.to_s
  else
    super
  end
end