Class: SayItWithGraphs::Line

Inherits:
Object
  • Object
show all
Defined in:
lib/say_it_with_graphs/line.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_numberObject (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

#positionObject

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