rallio 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ade13b37179b9aae4933fb452929369d2d3ef1b0
4
- data.tar.gz: d5465b01ab5f24df3070bf1c3b29fc3fafe66a7b
3
+ metadata.gz: e160a5c2e852d27441a5c386a38dffa2d4f4d219
4
+ data.tar.gz: 5e37c2fe67afdbb8f1d634b47eac1d6413a00f6d
5
5
  SHA512:
6
- metadata.gz: 85e9e0598dc5497503604455d420479c5a6ea90088672054d2ffc75a4d22515c0594fe5e1db8dde75ff54b483fa8da672a4bcd10fdf1c48a7ce6b6696cf71280
7
- data.tar.gz: 97ff5215c8fcdad9de133810d4a359d9987eeb848d5ff5f841ace63fd29555e50462b97ecff899a81d28f5d0313e821f729f880d6a23f4bec395816fe1745385
6
+ metadata.gz: 01424d9ac92ad4773732b7d1c4253f2c8aeb08c80d67e9c7f75b5394335eee36eccbfdb7624ffa48aa99c92c73f7b98ff5c7c83629e2f885198e64cd26e15fde
7
+ data.tar.gz: d889ea2e47a406188e256c7cd511544c540e231c8abcf2b38449b136717a6f94c07956da8dd5c3e2afa7991d70d88b7c1999f8e274a3fa0f685c2910c0a9335e
data/README.md CHANGED
@@ -254,24 +254,22 @@ accounts = Rallio::Account.for(franchisor_id: 200)
254
254
  # => [<Rallio::Account:0x007f801bb0a610 @id=100, @name="Awesome Haircuts New York City", @short_name="AH-NYC", @url="https://awesomehaircuts.fake", @city="New York", @country_code="US", @time_zone="Eastern Time (US & Canada)">]
255
255
  ```
256
256
 
257
- #### .created
257
+ #### .create
258
258
 
259
259
  Creates account for given franchisor_id.
260
260
 
261
261
  ```ruby
262
- payload = {
263
- account: {
264
- name: 'Awesome Test Account',
265
- short_name: 'ATA-1',
266
- url: 'https://ata.example',
267
- city: 'Narnia',
268
- country_code: 'US',
269
- time_zone: 'Central Time (US & Canada)'
270
- }
262
+ account = {
263
+ name: 'Awesome Test Account',
264
+ short_name: 'ATA-1',
265
+ url: 'https://ata.example',
266
+ city: 'Narnia',
267
+ country_code: 'US',
268
+ time_zone: 'Central Time (US & Canada)'
271
269
  }
272
270
 
273
- Rallio::Account.create(franchisor_id: 200, payload: payload)
274
- # => { account: { name: 'Awesome Test Account', short_name: 'ATA-1', url: 'https://ata.example', city: 'Narnia', country_code: 'US', time_zone: 'Central Time (US & Canada)' } }
271
+ Rallio::Account.create(franchisor_id: 200, account: account)
272
+ # => <Rallio::Account:0x007f801bb0a610 @id=100, @name="Awesome Test Account", @short_name="ATA-1", @url="https://ata.example", @city="Narnia", @country_code="US", @time_zone="Central Time (US & Canada)">
275
273
  ```
276
274
 
277
275
  #### #reviews
@@ -36,11 +36,17 @@ module Rallio
36
36
  # Creates an account.
37
37
  #
38
38
  # @param franchisor_id [Integer] franchisor_id to create account under
39
- # @param payload [Hash]
40
- # @option payload [Hash] :account data to create account with
41
- # @return [Hash] hash of account created
42
- def self.create(franchisor_id:, payload:)
43
- self.post("/franchisors/#{franchisor_id}/accounts", headers: app_credentials, body: payload).parsed_response
39
+ # @param account [Hash]
40
+ # @option account [String] :name
41
+ # @option account [String] :short_name slug or other identifier
42
+ # @option account [String] :url
43
+ # @option account [String] :city
44
+ # @option account [String] :country_code
45
+ # @option account [String] :time_zone
46
+ # @return [Rallio::Account] hash of account created
47
+ def self.create(franchisor_id:, account:)
48
+ response = self.post("/franchisors/#{franchisor_id}/accounts", headers: app_credentials, body: { account: account })
49
+ new response.parsed_response
44
50
  end
45
51
 
46
52
  # Retreives reviews for the account.
@@ -1,3 +1,3 @@
1
1
  module Rallio
2
- VERSION = "0.5.0"
2
+ VERSION = "0.6.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rallio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - JD Guzman
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-03-20 00:00:00.000000000 Z
11
+ date: 2017-03-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: virtus