Class: Prox

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/prox.rb,
lib/prox/version.rb

Defined Under Namespace

Classes: MissingObject

Constant Summary collapse

VERSION =
"0.0.1"

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

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

Raises:



30
31
32
33
# File 'lib/prox.rb', line 30

def method_missing(name, *args, &block)
  raise MissingObject, name unless __getobj__
  __getobj__.send name, *args, &block
end

Instance Method Details

#__proxy_class__Object



15
# File 'lib/prox.rb', line 15

alias __proxy_class__ class

#classObject



26
27
28
# File 'lib/prox.rb', line 26

def class
  __getobj__.class
end

#instance_of?(klass) ⇒ Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/prox.rb', line 22

def instance_of?(klass)
  __getobj__.instance_of? klass
end

#is_a?(klass) ⇒ Boolean Also known as: kind_of?

Returns:

  • (Boolean)


17
18
19
# File 'lib/prox.rb', line 17

def is_a?(klass)
  __getobj__.is_a? klass
end