Module: Scorpion::Method

Included in:
Object, Rails::ActiveRecord::Association, Rails::ActiveRecord::Relation
Defined in:
lib/scorpion/method.rb

Overview

Adds a #scorpion method to an object.

Instance Method Summary collapse

Instance Method Details

#scorpionScorpion #scorpion(scope) ⇒ scope

Overloads:

  • #scorpionScorpion

    Returns the object’s scorpion used to hunt down dependencies.

    Returns:

    • (Scorpion)

      the object’s scorpion used to hunt down dependencies.

  • #scorpion(scope) ⇒ scope

    Stings the given ‘scope` with the current scorpion.

    Parameters:

    • scope (#with_scorpion)

      an object that responds to #with_scorpion that receives the current scorpion.

    Returns:

    • (scope)

      stung object.



11
12
13
14
15
16
17
# File 'lib/scorpion/method.rb', line 11

def scorpion( scope = nil )
  if scope
    scope.with_scorpion( scorpion )
  else
    @scorpion
  end
end

#scorpion_huntObject



25
26
27
# File 'lib/scorpion/method.rb', line 25

def scorpion_hunt
  @scorpion_hunt
end