Class: Lab42::DiggyMethods

Inherits:
Object
  • Object
show all
Defined in:
lib/lab42/diggy_methods.rb,
lib/lab42/diggy_methods/version.rb

Constant Summary collapse

VERSION =
"0.1.7"

Instance Method Summary collapse

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