Class: David::Trap

Inherits:
Object
  • Object
show all
Defined in:
lib/david/trap.rb

Instance Method Summary collapse

Constructor Details

#initialize(value = nil) ⇒ Trap

Returns a new instance of Trap.



3
4
5
# File 'lib/david/trap.rb', line 3

def initialize(value = nil)
  @value = value
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args) ⇒ Object



7
8
9
10
# File 'lib/david/trap.rb', line 7

def method_missing(method, *args)
  p method, caller[0]
  @value.send(method, *args) unless @value.nil?
end