Class: Tryruby::ChallengeBuilder
- Inherits:
-
Object
- Object
- Tryruby::ChallengeBuilder
- Includes:
- Colors
- Defined in:
- lib/tryruby/challenge_builder.rb
Overview
Single challenge level builder
Instance Attribute Summary collapse
-
#display_setup ⇒ Object
(also: #display_setup)
writeonly
Sets the attribute display_setup.
-
#help ⇒ Object
(also: #help)
writeonly
Sets the attribute help.
- #setup(&block) ⇒ Object
- #test(&block) ⇒ Object
Instance Method Summary collapse
- #challenge ⇒ Object
-
#initialize ⇒ ChallengeBuilder
constructor
A new instance of ChallengeBuilder.
Methods included from Colors
Constructor Details
#initialize ⇒ ChallengeBuilder
13 14 15 16 17 18 |
# File 'lib/tryruby/challenge_builder.rb', line 13 def initialize @help = '' @test = nil @setup = nil @display_setup = false end |
Instance Attribute Details
#display_setup=(value) ⇒ Object (writeonly) Also known as: display_setup
Sets the attribute display_setup
9 10 11 |
# File 'lib/tryruby/challenge_builder.rb', line 9 def display_setup=(value) @display_setup = value end |
#help=(value) ⇒ Object (writeonly) Also known as: help
Sets the attribute help
9 10 11 |
# File 'lib/tryruby/challenge_builder.rb', line 9 def help=(value) @help = value end |
#setup(&block) ⇒ Object
24 25 26 |
# File 'lib/tryruby/challenge_builder.rb', line 24 def setup(&block) self.setup = block end |
#test(&block) ⇒ Object
20 21 22 |
# File 'lib/tryruby/challenge_builder.rb', line 20 def test(&block) self.test = block end |
Instance Method Details
#challenge ⇒ Object
28 29 30 |
# File 'lib/tryruby/challenge_builder.rb', line 28 def challenge Challenge.new(@help, @test, @setup, @display_setup) end |