Class: RCheck::DSL::Scope

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/rcheck/dsl.rb

Instance Method Summary collapse

Constructor Details

#initialize(suite) ⇒ Scope

Returns a new instance of Scope.



5
6
7
# File 'lib/rcheck/dsl.rb', line 5

def initialize(suite)
  @__suite__ = suite
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(*args) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/rcheck/dsl.rb', line 17

def method_missing(*args)
  if @__suite__.parent
    @__suite__.parent.scope.send(*args)
  else
    super
  end
end

Instance Method Details

#respond_to?(name) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/rcheck/dsl.rb', line 13

def respond_to?(name)
  super || @__suite__.parent && @__suite__.parent.scope.respond_to?(name)
end