Class: Shellfish::ProblemDsl
- Inherits:
-
Object
- Object
- Shellfish::ProblemDsl
- Defined in:
- lib/shellfish/problem_dsl.rb
Instance Attribute Summary collapse
-
#problem ⇒ Object
readonly
Returns the value of attribute problem.
Instance Method Summary collapse
- #description(text) ⇒ Object (also: #desc)
- #expected_result(text) ⇒ Object (also: #expected)
-
#initialize(problem, &block) ⇒ ProblemDsl
constructor
A new instance of ProblemDsl.
- #subject(text) ⇒ Object
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
#problem ⇒ Object (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 |