Class: TollBooth::RouteCollection

Inherits:
Array
  • Object
show all
Defined in:
lib/toll_booth/route_collection.rb

Overview

a collection of routes received from google after requesting directions if an error occurs, the collection will be empty and the errors attribute will be populated

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(size = 0, obj = nil) ⇒ RouteCollection

Returns a new instance of RouteCollection.



7
8
9
10
# File 'lib/toll_booth/route_collection.rb', line 7

def initialize(size = 0, obj = nil)
  super
  @errors = [] 
end

Instance Attribute Details

#errorsObject

Returns the value of attribute errors.



6
7
8
# File 'lib/toll_booth/route_collection.rb', line 6

def errors
  @errors
end

Instance Method Details

#found?Boolean

where routes found?

Returns:

  • (Boolean)

    whether routes were found or not



14
15
16
# File 'lib/toll_booth/route_collection.rb', line 14

def found?
  empty?
end