class Bart::Estimate

Attributes

bikeflag[R]
color[R]
direction[R]
hexcolor[R]
length[R]
minutes[R]
platform[R]

Public Class Methods

new(xml) click to toggle source
# File lib/bart/estimate.rb, line 8
def initialize(xml)
  document = Nokogiri::XML.parse(xml)

  @minutes   = document.css('minutes').text.to_i
  @platform  = document.css('platform').text.to_i
  @direction = document.css('direction').text
  @length    = document.css('length').text.to_i
  @color     = document.css('color').text
  @hexcolor  = document.css('hexcolor').text
  @bikeflag  = document.css('bikeflag').text.to_i == 1
end

Public Instance Methods

seconds() click to toggle source
# File lib/bart/estimate.rb, line 20
def seconds
  @minutes * 60
end
time() click to toggle source
# File lib/bart/estimate.rb, line 24
def time
  Time.now + seconds
end