Module: Piparote

Defined in:
lib/piparote.rb,
lib/piparote/version.rb

Defined Under Namespace

Classes: Object

Constant Summary collapse

VERSION =
"0.1.0"

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

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



4
5
6
7
# File 'lib/piparote.rb', line 4

def method_missing(name, *args, &block)
  return Piparote::Object.new(::Object.const_get(name), self) if name[0] =~ /[A-Z]/ && Object.const_defined?(name)
  send(name, self, &block) if respond_to?(name)
end