aboutsummaryrefslogtreecommitdiffstats
path: root/lib/tom_tom/batch.rb
AgeCommit message (Collapse)Author
2018-03-14TomTom::Batch: Extract code to `#extract_costs_to_way_costs!`Teddy Wing
Extract some code from `#batch` to allow us to test the part that takes distance and time values from the response JSON and put fill them into `WayCost`s. In order for the test to work, had to add an `#==` method to `WayCost` and make `distance` and `time` accessors. The JSON file fixture is a copy of a response from the TomTom `/batch` API. The file is pretty big. I'm not sure if maybe I should condense it for the sake of test performance. Refs #6095
2018-03-14TomTom::Batch: Rename `#convert_way_costs_for_batch`Teddy Wing
Rename to `#convert_way_costs` since this method now lives inside the `TomTom::Batch` class, so that part of the name became redundant. Refs #6095
2018-03-14TomTom: Provide `TomTom.batch(...)` methodTeddy Wing
This change enables us to call `TomTom.batch(...)` instead of `TomTom.new.batch(...)` a couple commits ago. This is nice because the initialisation was kind of unnecessary for users of the class. Refs #6095
2018-03-14tom_tom/batch: Use `module ...` syntaxTeddy Wing
Change the `TomTom::Batch` to `module ... class ...` syntax instead. I like this better in this case. Refs #6095
2018-03-14Move `lib/tom_tom.rb` to `lib/tom_tom/batch.rb`Teddy Wing
Separate the functionality a little better by moving the `/batch` endpoint code into a new class. The goal here is also to lay the foundation for being able to call `TomTom.batch()` instead of `TomTom.new.batch()`. Refs #6095