Skalar / google_distance_matrix

Ruby client for The Google Distance Matrix API.
MIT License
58 stars 45 forks source link

Add support for `channel` #35

Closed michaelgpearce closed 7 years ago

michaelgpearce commented 7 years ago

With a google business account, a channel parameter can also be specified to segment the incoming traffic. It looks like adding channel to GoogleDistanceMatrix::Configuration::ATTRIBUTES is all that is required to support this functionality.

For the time being, I have the Gem monkey patched with:

require 'google_distance_matrix/configuration'

GoogleDistanceMatrix::Configuration::ATTRIBUTES << 'channel'

module GoogleDistanceMatrix
  class Configuration
    attr_accessor :channel
  end
end
thhermansen commented 7 years ago

Hi, and thanks for the issue report.

For the time being I'm pretty busy at work so I don't know when I can look in to this myself.

Feel free to make a pull request which implements this if you have time time. Please include some automated tests for it too if you choose to make a pull request and I'll take a look at it when I got the time.

thhermansen commented 7 years ago

Thank you. I have merged your pull request now :-)