Class: Tryruby::Level
- Inherits:
-
Object
- Object
- Tryruby::Level
- Includes:
- Enumerable
- Defined in:
- lib/tryruby/level.rb
Overview
Single tutorial level
Instance Method Summary collapse
- #[](n) ⇒ Object
- #each(&block) ⇒ Object
-
#initialize(*challenges) ⇒ Level
constructor
A new instance of Level.
-
#length ⇒ Object
Number of challenges in level.
Constructor Details
#initialize(*challenges) ⇒ Level
Returns a new instance of Level.
6 7 8 |
# File 'lib/tryruby/level.rb', line 6 def initialize(*challenges) @challenges = challenges end |
Instance Method Details
#[](n) ⇒ Object
10 11 12 |
# File 'lib/tryruby/level.rb', line 10 def [](n) @challenges[n] end |
#each(&block) ⇒ Object
14 15 16 |
# File 'lib/tryruby/level.rb', line 14 def each(&block) @challenges.each(&block) end |
#length ⇒ Object
Number of challenges in level
19 20 21 |
# File 'lib/tryruby/level.rb', line 19 def length @challenges.length end |