Class: Spectus::Challenge

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

Overview

This class contains a challenge to apply against an object.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(method_id, *args) ⇒ Challenge

Initialize the challenge class.

Parameters:

  • method_id (#to_sym)

    the identifier of a method.

  • args (Array)

    the arguments of the method.



11
12
13
14
# File 'lib/spectus/challenge.rb', line 11

def initialize(method_id, *args)
  @symbol = method_id.to_sym
  @args   = args
end

Instance Attribute Details

#argsArray (readonly)

Returns The parameters following the method.

Returns:

  • (Array)

    The parameters following the method.



24
25
26
# File 'lib/spectus/challenge.rb', line 24

def args
  @args
end

#symbolSymbol (readonly)

Returns The method to call on the subject.

Returns:

  • (Symbol)

    The method to call on the subject.



19
20
21
# File 'lib/spectus/challenge.rb', line 19

def symbol
  @symbol
end