rallio 0.4.4 → 0.4.5

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: a3933404e2df7df9e875aa16e3e821cba6aef8e3
4
- data.tar.gz: db0aac98880dfb8e440404fd8bd19f9a8d816547
3
+ metadata.gz: 173b2cc079841141428af0d262190965338cf565
4
+ data.tar.gz: eb80eed426664e0e41b7959fdf6052e31d80ca0a
5
5
  SHA512:
6
- metadata.gz: 05cc3bce6a064539340d13b709b47d4335d816d36c28ea3136b686c0dcb65049ac7d349bc3e655fe73de0e032a637258c3e45c677b7d71037b34f08a24396d62
7
- data.tar.gz: 5c8dcad5002ada21689e2671f52aea4092fde0f4f210e319f789f2280b166559a2532d95ccf85e464c03828810eca37f5b818e5935e8a0e1b51bac36bcd577c4
6
+ metadata.gz: 9d0e892a1f8692f05565e994680e5e3024054ac1ef50422bce25243c5e322f6627d0d7b06229728c12c5560a5a6f71b29fd8ff5b70ce9fee8c2a3ad55b3fa5f4
7
+ data.tar.gz: 2ddced76f1d321a8863449803cda3ce4ee351b2562915d09c99d79f995fa94c141c1a78d625e6981e690f36fed91108854a80322e9adfc8ea692805d038b0a6c
@@ -17,8 +17,8 @@ module Rallio
17
17
 
18
18
  # Creates new access token for user_id.
19
19
  #
20
- # NOTE: These token do not expire so it is suggested (recommended) that the
21
- # token be cached and reused whenever possible.
20
+ # NOTE: These tokens do not expire so it is suggested (recommended) that the
21
+ # token be cached and reused whenever possible.
22
22
  #
23
23
  # @param user_id [Integer]
24
24
  # @return [Rallio::AccessToken]
@@ -1,5 +1,14 @@
1
1
  module Rallio
2
- class Franchisor < Account
2
+ # Represents an franchisor object as it comes from Rallio.
3
+ #
4
+ # @!attribute [rw] id
5
+ # @return [Integer] unique id for franchisor
6
+ # @!attribute [rw] name
7
+ # @return [String] account name
8
+ class Franchisor < Base
9
+ attribute :id, Integer
10
+ attribute :name, String
11
+
3
12
  # Retreives all franchisors for a given application.
4
13
  #
5
14
  # @return [Array<Rallio::Franchisor>]
@@ -16,6 +25,14 @@ module Rallio
16
25
  Rallio::Account.for(franchisor_id: id)
17
26
  end
18
27
 
28
+ # Retreives reviews for the franchisor.
29
+ #
30
+ # @param access_token [String] user access token for API access to account
31
+ # @return [Array<Rallio::Review>]
32
+ def reviews(access_token:)
33
+ Review.all(type: type, id: id, access_token: access_token)
34
+ end
35
+
19
36
  private
20
37
 
21
38
  def type
@@ -25,7 +25,7 @@ module Rallio
25
25
  # @return [Array<Rallio::User>] array of users accessible to application
26
26
  def self.accessible_users
27
27
  response = self.get('/accessible_users', headers: app_credentials)
28
- response.parsed_response['users'].map { |u| User.new(u) }
28
+ response.parsed_response['users'].map { |u| new u }
29
29
  end
30
30
 
31
31
  # Create a user on the Rallio platform.
@@ -51,6 +51,9 @@ module Rallio
51
51
  # Creates or returns the API access token for user.
52
52
  # @see Rallio::AccessToken
53
53
  #
54
+ # NOTE: These tokens do not expire so it is suggested (recommended) that the
55
+ # token be cached and reused whenever possible.
56
+ #
54
57
  # @return [Rallio::AccessToken]
55
58
  def access_token
56
59
  @access_token ||= AccessToken.create(user_id: id)
@@ -1,3 +1,3 @@
1
1
  module Rallio
2
- VERSION = "0.4.4"
2
+ VERSION = "0.4.5"
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.4.4
4
+ version: 0.4.5
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-14 00:00:00.000000000 Z
11
+ date: 2017-03-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: virtus