Module: Ripl::Irb::MockIrb

Defined in:
lib/ripl/irb.rb

Constant Summary collapse

ACTUAL_IRB_CLASSES =
[:Irb]

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missingObject



73
74
# File 'lib/ripl/irb.rb', line 73

def method_missing(*)
end

Instance Method Details

#const_missing(*args) ⇒ Object



64
65
66
67
68
69
70
71
# File 'lib/ripl/irb.rb', line 64

def const_missing(*args)
  mock = if ACTUAL_IRB_CLASSES.include?(args[0])
    Class.new.extend(MockIrb)
  else
    Module.new.extend(MockIrb)
  end
  self.const_set(args[0], mock)
end