Class: Fix::It Private

Inherits:
Spectus::ExpectationTarget
  • Object
show all
Defined in:
lib/fix/it.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Wraps the target of an expectation.

Instance Method Summary collapse

Constructor Details

#initialize(subject, challenges, helpers) ⇒ It

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Create a new expection target

Parameters:

  • subject (BasicObject)

    The front object.

  • challenges (Array)

    The list of challenges.

  • helpers (Hash)

    The list of helpers.



14
15
16
17
18
# File 'lib/fix/it.rb', line 14

def initialize(subject, challenges, helpers)
  @subject    = subject
  @challenges = challenges
  @helpers    = helpers
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

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

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Override Ruby’s method_missing in order to provide let interface.

Raises:

  • (NoMethodError)

    If doesn’t respond to the given method.

Since:

  • 0.11.0



26
27
28
# File 'lib/fix/it.rb', line 26

def method_missing(name, *args, &block)
  @helpers.key?(name) ? @helpers.fetch(name).call : super
end