Class: Shellfish::ProblemDsl

Inherits:
Object
  • Object
show all
Defined in:
lib/shellfish/problem_dsl.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(problem, &block) ⇒ ProblemDsl

Returns a new instance of ProblemDsl.



5
6
7
8
# File 'lib/shellfish/problem_dsl.rb', line 5

def initialize(problem, &block)
  @problem = problem
  instance_eval(&block) if block_given?
end

Instance Attribute Details

#problemObject (readonly)

Returns the value of attribute problem.



3
4
5
# File 'lib/shellfish/problem_dsl.rb', line 3

def problem
  @problem
end

Instance Method Details

#description(text) ⇒ Object Also known as: desc



14
15
16
# File 'lib/shellfish/problem_dsl.rb', line 14

def description(text)
  @problem.description = text
end

#expected_result(text) ⇒ Object Also known as: expected



19
20
21
# File 'lib/shellfish/problem_dsl.rb', line 19

def expected_result(text)
  @problem.expected_result = text
end

#subject(text) ⇒ Object



10
11
12
# File 'lib/shellfish/problem_dsl.rb', line 10

def subject(text)
  @problem.subject = text
end