Class: Void

Inherits:
Object show all
Defined in:
lib/rmtools/dev/void.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(m, *args) ⇒ Object

abc = Void.new (abc.first.get {|_| !_}.something << ‘blah blah’).raise!

> #<Void:0xb66367b0>

Think twice before use it. It may devour your code!



10
11
12
13
14
15
16
17
# File 'lib/rmtools/dev/void.rb', line 10

def method_missing(m, *args)
  case m.to_s[-1,1]
  when '?'; false
  when '!'; nil
  when '='; args.first
  else self
  end
end

Instance Method Details

#bObject



19
# File 'lib/rmtools/dev/void.rb', line 19

def b; false end