Class: Tube::Line

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

Overview

Models the data gathered on a tube line from the tfl.gov.uk “Live travel news” page.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, name, status, problem, message = nil) ⇒ Line

:call-seq: Line.new(id, name, status, problem, message=nil)

Create a new Line.



15
16
17
18
19
20
21
# File 'lib/tube/line.rb', line 15

def initialize( id, name, status, problem, message=nil )
  @id = id
  @name = name
  @status = status
  @problem = problem
  @message = message
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



7
8
9
# File 'lib/tube/line.rb', line 7

def id
  @id
end

#messageObject

Returns the value of attribute message.



8
9
10
# File 'lib/tube/line.rb', line 8

def message
  @message
end

#nameObject

Returns the value of attribute name.



8
9
10
# File 'lib/tube/line.rb', line 8

def name
  @name
end

#problemObject Also known as: problem?

Returns the value of attribute problem.



8
9
10
# File 'lib/tube/line.rb', line 8

def problem
  @problem
end

#statusObject

Returns the value of attribute status.



8
9
10
# File 'lib/tube/line.rb', line 8

def status
  @status
end