Class: Mock::Turtle

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

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Turtle

Returns a new instance of Turtle.



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

def initialize(*args)
  # no-op
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(*args) ⇒ Object

It’s turtles all the way down…



8
9
10
# File 'lib/mock_turtle.rb', line 8

def method_missing(*args)
  Mock::Turtle.new
end

Instance Method Details

#respond_to?(method) ⇒ Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/mock_turtle.rb', line 12

def respond_to?(method)
  true
end