Class: SayItWithGraphs::Line
- Inherits:
-
Object
- Object
- SayItWithGraphs::Line
- Defined in:
- lib/say_it_with_graphs/line.rb
Instance Attribute Summary collapse
-
#line_number ⇒ Object
readonly
Returns the value of attribute line_number.
-
#position ⇒ Object
Returns the value of attribute position.
Instance Method Summary collapse
- #[](key) ⇒ Object
-
#initialize(position = 0, line_number = 1) ⇒ Line
constructor
A new instance of Line.
Constructor Details
#initialize(position = 0, line_number = 1) ⇒ Line
Returns a new instance of Line.
8 9 10 11 |
# File 'lib/say_it_with_graphs/line.rb', line 8 def initialize(position = 0, line_number = 1) @position = position @line_number = line_number end |
Instance Attribute Details
#line_number ⇒ Object (readonly)
Returns the value of attribute line_number.
4 5 6 |
# File 'lib/say_it_with_graphs/line.rb', line 4 def line_number @line_number end |
#position ⇒ Object
Returns the value of attribute position.
3 4 5 |
# File 'lib/say_it_with_graphs/line.rb', line 3 def position @position end |
Instance Method Details
#[](key) ⇒ Object
13 14 15 16 |
# File 'lib/say_it_with_graphs/line.rb', line 13 def [](key) @line_number = key self end |