Class: Lab42::DiggyMethods
- Inherits:
-
Object
- Object
- Lab42::DiggyMethods
- Defined in:
- lib/lab42/diggy_methods.rb,
lib/lab42/diggy_methods/version.rb
Constant Summary collapse
- VERSION =
"0.1.7"
Instance Method Summary collapse
-
#__binding__ ⇒ Object
Expose for ERB.
-
#__data__ ⇒ Object
In case data has key :data (often the case).
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name) ⇒ Object (private)
41 42 43 44 45 46 47 |
# File 'lib/lab42/diggy_methods.rb', line 41 def method_missing(name, *) if name.to_s.end_with?"!" @data.fetch(name.to_s.sub(/!\z/, "").to_sym) else _method_missing_try_descend(name) end end |
Instance Method Details
#__binding__ ⇒ Object
Expose for ERB
8 |
# File 'lib/lab42/diggy_methods.rb', line 8 def __binding__; binding end |
#__data__ ⇒ Object
In case data has key :data (often the case)
11 |
# File 'lib/lab42/diggy_methods.rb', line 11 def __data__; @data end |