Class: Checklist::Step

Inherits:
Struct
  • Object
show all
Defined in:
lib/checklist/step.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#challengeObject

Returns the value of attribute challenge

Returns:

  • (Object)

    the current value of challenge



2
3
4
# File 'lib/checklist/step.rb', line 2

def challenge
  @challenge
end

#codeObject

Returns the value of attribute code

Returns:

  • (Object)

    the current value of code



2
3
4
# File 'lib/checklist/step.rb', line 2

def code
  @code
end

#descriptionObject

Returns the value of attribute description

Returns:

  • (Object)

    the current value of description



2
3
4
# File 'lib/checklist/step.rb', line 2

def description
  @description
end

#responseObject

Returns the value of attribute response

Returns:

  • (Object)

    the current value of response



2
3
4
# File 'lib/checklist/step.rb', line 2

def response
  @response
end

Instance Method Details

#run!Object

Run checklist’s body code



4
5
6
# File 'lib/checklist/step.rb', line 4

def run!
  self.code.call
end

#to_hashObject



8
9
10
11
12
# File 'lib/checklist/step.rb', line 8

def to_hash
  { "Challenge" => self.challenge,
    "Response" => self.response, 
    "Description" => self.description }
end