Class: Devlog::Settings
- Inherits:
-
Hash
- Object
- Hash
- Devlog::Settings
- 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
15 16 17 18 19 20 21 22 23 |
# File 'lib/devlog/settings.rb', line 15 def method_missing(m, *args, &block) if key?(m) fetch m elsif key?(m.to_s) fetch m.to_s else super end end |
Instance Method Details
#has?(m) ⇒ Boolean
11 12 13 |
# File 'lib/devlog/settings.rb', line 11 def has?(m) return key?(m) || key?(m.to_s) end |