Conversation
| @@ -1 +1 @@ | |||
| 2.2 | |||
| 2.2.8 | |||
There was a problem hiding this comment.
Is this the min required version? Should this even be checked in for a gem? Shouldn't we set required_ruby_version in gemspec instead?
| A Ruby gem for interacting with the [Phaxio API](https://www.phaxio.com/docs/api/v2). | ||
|
|
||
| **Note: This gem only runs on Ruby version 1.9.+** | ||
| **NOTE: Versions of this gem before 2.1.0.0 are considered "beta". Breaking changes may be more |
There was a problem hiding this comment.
Why would we make breaking changes? :-) And why not version 2.0.0?
|
|
||
| gem 'phaxio' | ||
| ``` ruby | ||
| gem 'phaxio', '2.1.0.0' |
| # @api private | ||
|
|
||
| class Client | ||
| BASE_URL = 'https://api.phaxio.com/v2/' |
There was a problem hiding this comment.
It would be nice if it was possible to override this with something like Phaxio.api_endpoint so that we can point it to runscope, etc.
| config.api_secret = "12345678910" | ||
| end | ||
| ``` ruby | ||
| Phaxio.api_key = '11111' |
There was a problem hiding this comment.
For the ruby n00b who's using this as a tutorial, I'd include the require 'phaxio' line here too.
| # A hash of parameters to send to Phaxio. | ||
| # - *country_code* [Integer] - An E.164 country code that you'd like to filter by. | ||
| # - *area_code* [Integer] - An area code that you'd like to filter by. If an area code is | ||
| # specified, then *country* is required. |
| Get a list of supported countries. | ||
|
|
||
| ``` ruby | ||
| Fax.supported_countries |
There was a problem hiding this comment.
In the other v2 client libs, we do something like Public::Country.list to more closely match the API path.
| # => true | ||
| ``` | ||
|
|
||
| ##### `PhoneNumber.list_available_area_codes` |
|
@jpettettphaxio Those changes have been made. |
| # => true | ||
| ``` | ||
|
|
||
| #### `Public::Country` |
There was a problem hiding this comment.
I think this should be:
#### Countries
##### `Public::Country.list`
|
|
||
| #### Area Codes | ||
|
|
||
| ##### `Public::AreaCode` |
|
|
||
| ``` ruby | ||
| area_codes = Public::AreaCode.list toll_free: true | ||
| # => Phaxio::Resource::Collection([Public::AreaCode(city: 'Chicago', ...), ...], page: 1) |
There was a problem hiding this comment.
This is syntactically correct, but when toll_free is true, city will always be "Toll Free Service"
| @@ -0,0 +1,77 @@ | |||
| --- | |||
There was a problem hiding this comment.
This file appears to be an unused duplicate of area_codes/list.yml
This is a complete rewrite for v2. I've differed in a few ways from our SDK guidelines for the sake of an idiomatic API, e.g. having only one params hash for arguments so that
Fax.create to: '...', api_key: '1234'would work without needing additional commas and braces.Looks like the build is failing for 1.9.3 because the version of bundler they're running thinks dependencies on a particular version of Ruby are for a gem called
ruby.Also, tests aren't being Run. Need to add a Rake task for running them.