Class: Basic101::Line

Inherits:
Object
  • Object
show all
Includes:
Identity
Defined in:
lib/basic101/line.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Identity

#==

Constructor Details

#initialize(line_number, statements) ⇒ Line

Returns a new instance of Line.



12
13
14
15
16
# File 'lib/basic101/line.rb', line 12

def initialize(line_number, statements)
  @line_number = line_number.to_i
  @statements = statements
  link_statements_to_line
end

Instance Attribute Details

#line_numberObject (readonly)

Returns the value of attribute line_number.



9
10
11
# File 'lib/basic101/line.rb', line 9

def line_number
  @line_number
end

#statementsObject (readonly)

Returns the value of attribute statements.



10
11
12
# File 'lib/basic101/line.rb', line 10

def statements
  @statements
end