Class: Rallio::Account

Inherits:
Base
  • Object
show all
Defined in:
lib/rallio/account.rb

Overview

Represents an account object as it comes from Rallio.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

app_credentials

Instance Attribute Details

#cityString

Returns account city.

Returns:

  • (String)

    account city



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/rallio/account.rb', line 28

class Account < Base
  attribute :id, Integer
  attribute :name, String
  attribute :short_name, String
  attribute :url, String
  attribute :city, String
  attribute :country_code, String
  attribute :time_zone, String
  attribute :franchisor_id, Integer
  attribute :franchisor_name, String
  attribute :facebook_connected, Axiom::Types::Boolean
  attribute :yelp_connected, Axiom::Types::Boolean
  attribute :google_connected, Axiom::Types::Boolean

  # Retreives accounts.
  #
  # @param franchisor_id [Integer] franchisor_id to get accounts for
  # @return [Array<Rallio::Account>]
  def self.for(franchisor_id:)
    response = self.get("/franchisors/#{franchisor_id}/accounts", headers: app_credentials)
    response.parsed_response['accounts'].map { |a| new a }
  end

  # Creates an account.
  #
  # @param franchisor_id [Integer] franchisor_id to create account under
  # @param account [Hash]
  # @option account [String] :name
  # @option account [String] :short_name slug or other identifier
  # @option account [String] :url
  # @option account [String] :city
  # @option account [String] :country_code
  # @option account [String] :time_zone
  # @return [Rallio::Account] hash of account created
  def self.create(franchisor_id:, account:)
    response = self.post("/franchisors/#{franchisor_id}/accounts", headers: app_credentials, body: { account:  })
    new response.parsed_response['account']
  end

  # Retreives reviews for the account.
  #
  # @param access_token [String] user access token for API access to account
  # @return [Array<Rallio::Review>]
  def reviews(access_token:)
    Review.all(type: type, id: id, access_token: access_token)
  end

  private

  def type
    :accounts
  end
end

#country_codeString

Returns account country code.

Returns:

  • (String)

    account country code



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/rallio/account.rb', line 28

class Account < Base
  attribute :id, Integer
  attribute :name, String
  attribute :short_name, String
  attribute :url, String
  attribute :city, String
  attribute :country_code, String
  attribute :time_zone, String
  attribute :franchisor_id, Integer
  attribute :franchisor_name, String
  attribute :facebook_connected, Axiom::Types::Boolean
  attribute :yelp_connected, Axiom::Types::Boolean
  attribute :google_connected, Axiom::Types::Boolean

  # Retreives accounts.
  #
  # @param franchisor_id [Integer] franchisor_id to get accounts for
  # @return [Array<Rallio::Account>]
  def self.for(franchisor_id:)
    response = self.get("/franchisors/#{franchisor_id}/accounts", headers: app_credentials)
    response.parsed_response['accounts'].map { |a| new a }
  end

  # Creates an account.
  #
  # @param franchisor_id [Integer] franchisor_id to create account under
  # @param account [Hash]
  # @option account [String] :name
  # @option account [String] :short_name slug or other identifier
  # @option account [String] :url
  # @option account [String] :city
  # @option account [String] :country_code
  # @option account [String] :time_zone
  # @return [Rallio::Account] hash of account created
  def self.create(franchisor_id:, account:)
    response = self.post("/franchisors/#{franchisor_id}/accounts", headers: app_credentials, body: { account:  })
    new response.parsed_response['account']
  end

  # Retreives reviews for the account.
  #
  # @param access_token [String] user access token for API access to account
  # @return [Array<Rallio::Review>]
  def reviews(access_token:)
    Review.all(type: type, id: id, access_token: access_token)
  end

  private

  def type
    :accounts
  end
end

#facebook_connectedString

Returns facebook has been associated.

Returns:

  • (String)

    facebook has been associated



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/rallio/account.rb', line 28

class Account < Base
  attribute :id, Integer
  attribute :name, String
  attribute :short_name, String
  attribute :url, String
  attribute :city, String
  attribute :country_code, String
  attribute :time_zone, String
  attribute :franchisor_id, Integer
  attribute :franchisor_name, String
  attribute :facebook_connected, Axiom::Types::Boolean
  attribute :yelp_connected, Axiom::Types::Boolean
  attribute :google_connected, Axiom::Types::Boolean

  # Retreives accounts.
  #
  # @param franchisor_id [Integer] franchisor_id to get accounts for
  # @return [Array<Rallio::Account>]
  def self.for(franchisor_id:)
    response = self.get("/franchisors/#{franchisor_id}/accounts", headers: app_credentials)
    response.parsed_response['accounts'].map { |a| new a }
  end

  # Creates an account.
  #
  # @param franchisor_id [Integer] franchisor_id to create account under
  # @param account [Hash]
  # @option account [String] :name
  # @option account [String] :short_name slug or other identifier
  # @option account [String] :url
  # @option account [String] :city
  # @option account [String] :country_code
  # @option account [String] :time_zone
  # @return [Rallio::Account] hash of account created
  def self.create(franchisor_id:, account:)
    response = self.post("/franchisors/#{franchisor_id}/accounts", headers: app_credentials, body: { account:  })
    new response.parsed_response['account']
  end

  # Retreives reviews for the account.
  #
  # @param access_token [String] user access token for API access to account
  # @return [Array<Rallio::Review>]
  def reviews(access_token:)
    Review.all(type: type, id: id, access_token: access_token)
  end

  private

  def type
    :accounts
  end
end

#franchisor_idString

Returns franchisor_id account belongs to.

Returns:

  • (String)

    franchisor_id account belongs to



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/rallio/account.rb', line 28

class Account < Base
  attribute :id, Integer
  attribute :name, String
  attribute :short_name, String
  attribute :url, String
  attribute :city, String
  attribute :country_code, String
  attribute :time_zone, String
  attribute :franchisor_id, Integer
  attribute :franchisor_name, String
  attribute :facebook_connected, Axiom::Types::Boolean
  attribute :yelp_connected, Axiom::Types::Boolean
  attribute :google_connected, Axiom::Types::Boolean

  # Retreives accounts.
  #
  # @param franchisor_id [Integer] franchisor_id to get accounts for
  # @return [Array<Rallio::Account>]
  def self.for(franchisor_id:)
    response = self.get("/franchisors/#{franchisor_id}/accounts", headers: app_credentials)
    response.parsed_response['accounts'].map { |a| new a }
  end

  # Creates an account.
  #
  # @param franchisor_id [Integer] franchisor_id to create account under
  # @param account [Hash]
  # @option account [String] :name
  # @option account [String] :short_name slug or other identifier
  # @option account [String] :url
  # @option account [String] :city
  # @option account [String] :country_code
  # @option account [String] :time_zone
  # @return [Rallio::Account] hash of account created
  def self.create(franchisor_id:, account:)
    response = self.post("/franchisors/#{franchisor_id}/accounts", headers: app_credentials, body: { account:  })
    new response.parsed_response['account']
  end

  # Retreives reviews for the account.
  #
  # @param access_token [String] user access token for API access to account
  # @return [Array<Rallio::Review>]
  def reviews(access_token:)
    Review.all(type: type, id: id, access_token: access_token)
  end

  private

  def type
    :accounts
  end
end

#franchisor_nameString

Returns franchisor_name account belongs to.

Returns:

  • (String)

    franchisor_name account belongs to



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/rallio/account.rb', line 28

class Account < Base
  attribute :id, Integer
  attribute :name, String
  attribute :short_name, String
  attribute :url, String
  attribute :city, String
  attribute :country_code, String
  attribute :time_zone, String
  attribute :franchisor_id, Integer
  attribute :franchisor_name, String
  attribute :facebook_connected, Axiom::Types::Boolean
  attribute :yelp_connected, Axiom::Types::Boolean
  attribute :google_connected, Axiom::Types::Boolean

  # Retreives accounts.
  #
  # @param franchisor_id [Integer] franchisor_id to get accounts for
  # @return [Array<Rallio::Account>]
  def self.for(franchisor_id:)
    response = self.get("/franchisors/#{franchisor_id}/accounts", headers: app_credentials)
    response.parsed_response['accounts'].map { |a| new a }
  end

  # Creates an account.
  #
  # @param franchisor_id [Integer] franchisor_id to create account under
  # @param account [Hash]
  # @option account [String] :name
  # @option account [String] :short_name slug or other identifier
  # @option account [String] :url
  # @option account [String] :city
  # @option account [String] :country_code
  # @option account [String] :time_zone
  # @return [Rallio::Account] hash of account created
  def self.create(franchisor_id:, account:)
    response = self.post("/franchisors/#{franchisor_id}/accounts", headers: app_credentials, body: { account:  })
    new response.parsed_response['account']
  end

  # Retreives reviews for the account.
  #
  # @param access_token [String] user access token for API access to account
  # @return [Array<Rallio::Review>]
  def reviews(access_token:)
    Review.all(type: type, id: id, access_token: access_token)
  end

  private

  def type
    :accounts
  end
end

#google_connectedString

Returns google has been associated.

Returns:

  • (String)

    google has been associated



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/rallio/account.rb', line 28

class Account < Base
  attribute :id, Integer
  attribute :name, String
  attribute :short_name, String
  attribute :url, String
  attribute :city, String
  attribute :country_code, String
  attribute :time_zone, String
  attribute :franchisor_id, Integer
  attribute :franchisor_name, String
  attribute :facebook_connected, Axiom::Types::Boolean
  attribute :yelp_connected, Axiom::Types::Boolean
  attribute :google_connected, Axiom::Types::Boolean

  # Retreives accounts.
  #
  # @param franchisor_id [Integer] franchisor_id to get accounts for
  # @return [Array<Rallio::Account>]
  def self.for(franchisor_id:)
    response = self.get("/franchisors/#{franchisor_id}/accounts", headers: app_credentials)
    response.parsed_response['accounts'].map { |a| new a }
  end

  # Creates an account.
  #
  # @param franchisor_id [Integer] franchisor_id to create account under
  # @param account [Hash]
  # @option account [String] :name
  # @option account [String] :short_name slug or other identifier
  # @option account [String] :url
  # @option account [String] :city
  # @option account [String] :country_code
  # @option account [String] :time_zone
  # @return [Rallio::Account] hash of account created
  def self.create(franchisor_id:, account:)
    response = self.post("/franchisors/#{franchisor_id}/accounts", headers: app_credentials, body: { account:  })
    new response.parsed_response['account']
  end

  # Retreives reviews for the account.
  #
  # @param access_token [String] user access token for API access to account
  # @return [Array<Rallio::Review>]
  def reviews(access_token:)
    Review.all(type: type, id: id, access_token: access_token)
  end

  private

  def type
    :accounts
  end
end

#idInteger

Returns unique id for account.

Returns:

  • (Integer)

    unique id for account



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/rallio/account.rb', line 28

class Account < Base
  attribute :id, Integer
  attribute :name, String
  attribute :short_name, String
  attribute :url, String
  attribute :city, String
  attribute :country_code, String
  attribute :time_zone, String
  attribute :franchisor_id, Integer
  attribute :franchisor_name, String
  attribute :facebook_connected, Axiom::Types::Boolean
  attribute :yelp_connected, Axiom::Types::Boolean
  attribute :google_connected, Axiom::Types::Boolean

  # Retreives accounts.
  #
  # @param franchisor_id [Integer] franchisor_id to get accounts for
  # @return [Array<Rallio::Account>]
  def self.for(franchisor_id:)
    response = self.get("/franchisors/#{franchisor_id}/accounts", headers: app_credentials)
    response.parsed_response['accounts'].map { |a| new a }
  end

  # Creates an account.
  #
  # @param franchisor_id [Integer] franchisor_id to create account under
  # @param account [Hash]
  # @option account [String] :name
  # @option account [String] :short_name slug or other identifier
  # @option account [String] :url
  # @option account [String] :city
  # @option account [String] :country_code
  # @option account [String] :time_zone
  # @return [Rallio::Account] hash of account created
  def self.create(franchisor_id:, account:)
    response = self.post("/franchisors/#{franchisor_id}/accounts", headers: app_credentials, body: { account:  })
    new response.parsed_response['account']
  end

  # Retreives reviews for the account.
  #
  # @param access_token [String] user access token for API access to account
  # @return [Array<Rallio::Review>]
  def reviews(access_token:)
    Review.all(type: type, id: id, access_token: access_token)
  end

  private

  def type
    :accounts
  end
end

#nameString

Returns account name.

Returns:

  • (String)

    account name



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/rallio/account.rb', line 28

class Account < Base
  attribute :id, Integer
  attribute :name, String
  attribute :short_name, String
  attribute :url, String
  attribute :city, String
  attribute :country_code, String
  attribute :time_zone, String
  attribute :franchisor_id, Integer
  attribute :franchisor_name, String
  attribute :facebook_connected, Axiom::Types::Boolean
  attribute :yelp_connected, Axiom::Types::Boolean
  attribute :google_connected, Axiom::Types::Boolean

  # Retreives accounts.
  #
  # @param franchisor_id [Integer] franchisor_id to get accounts for
  # @return [Array<Rallio::Account>]
  def self.for(franchisor_id:)
    response = self.get("/franchisors/#{franchisor_id}/accounts", headers: app_credentials)
    response.parsed_response['accounts'].map { |a| new a }
  end

  # Creates an account.
  #
  # @param franchisor_id [Integer] franchisor_id to create account under
  # @param account [Hash]
  # @option account [String] :name
  # @option account [String] :short_name slug or other identifier
  # @option account [String] :url
  # @option account [String] :city
  # @option account [String] :country_code
  # @option account [String] :time_zone
  # @return [Rallio::Account] hash of account created
  def self.create(franchisor_id:, account:)
    response = self.post("/franchisors/#{franchisor_id}/accounts", headers: app_credentials, body: { account:  })
    new response.parsed_response['account']
  end

  # Retreives reviews for the account.
  #
  # @param access_token [String] user access token for API access to account
  # @return [Array<Rallio::Review>]
  def reviews(access_token:)
    Review.all(type: type, id: id, access_token: access_token)
  end

  private

  def type
    :accounts
  end
end

#short_nameString

Returns account short name.

Returns:

  • (String)

    account short name



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/rallio/account.rb', line 28

class Account < Base
  attribute :id, Integer
  attribute :name, String
  attribute :short_name, String
  attribute :url, String
  attribute :city, String
  attribute :country_code, String
  attribute :time_zone, String
  attribute :franchisor_id, Integer
  attribute :franchisor_name, String
  attribute :facebook_connected, Axiom::Types::Boolean
  attribute :yelp_connected, Axiom::Types::Boolean
  attribute :google_connected, Axiom::Types::Boolean

  # Retreives accounts.
  #
  # @param franchisor_id [Integer] franchisor_id to get accounts for
  # @return [Array<Rallio::Account>]
  def self.for(franchisor_id:)
    response = self.get("/franchisors/#{franchisor_id}/accounts", headers: app_credentials)
    response.parsed_response['accounts'].map { |a| new a }
  end

  # Creates an account.
  #
  # @param franchisor_id [Integer] franchisor_id to create account under
  # @param account [Hash]
  # @option account [String] :name
  # @option account [String] :short_name slug or other identifier
  # @option account [String] :url
  # @option account [String] :city
  # @option account [String] :country_code
  # @option account [String] :time_zone
  # @return [Rallio::Account] hash of account created
  def self.create(franchisor_id:, account:)
    response = self.post("/franchisors/#{franchisor_id}/accounts", headers: app_credentials, body: { account:  })
    new response.parsed_response['account']
  end

  # Retreives reviews for the account.
  #
  # @param access_token [String] user access token for API access to account
  # @return [Array<Rallio::Review>]
  def reviews(access_token:)
    Review.all(type: type, id: id, access_token: access_token)
  end

  private

  def type
    :accounts
  end
end

#time_zoneString

Returns account time zone.

Returns:

  • (String)

    account time zone



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/rallio/account.rb', line 28

class Account < Base
  attribute :id, Integer
  attribute :name, String
  attribute :short_name, String
  attribute :url, String
  attribute :city, String
  attribute :country_code, String
  attribute :time_zone, String
  attribute :franchisor_id, Integer
  attribute :franchisor_name, String
  attribute :facebook_connected, Axiom::Types::Boolean
  attribute :yelp_connected, Axiom::Types::Boolean
  attribute :google_connected, Axiom::Types::Boolean

  # Retreives accounts.
  #
  # @param franchisor_id [Integer] franchisor_id to get accounts for
  # @return [Array<Rallio::Account>]
  def self.for(franchisor_id:)
    response = self.get("/franchisors/#{franchisor_id}/accounts", headers: app_credentials)
    response.parsed_response['accounts'].map { |a| new a }
  end

  # Creates an account.
  #
  # @param franchisor_id [Integer] franchisor_id to create account under
  # @param account [Hash]
  # @option account [String] :name
  # @option account [String] :short_name slug or other identifier
  # @option account [String] :url
  # @option account [String] :city
  # @option account [String] :country_code
  # @option account [String] :time_zone
  # @return [Rallio::Account] hash of account created
  def self.create(franchisor_id:, account:)
    response = self.post("/franchisors/#{franchisor_id}/accounts", headers: app_credentials, body: { account:  })
    new response.parsed_response['account']
  end

  # Retreives reviews for the account.
  #
  # @param access_token [String] user access token for API access to account
  # @return [Array<Rallio::Review>]
  def reviews(access_token:)
    Review.all(type: type, id: id, access_token: access_token)
  end

  private

  def type
    :accounts
  end
end

#urlString

Returns account url.

Returns:

  • (String)

    account url



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/rallio/account.rb', line 28

class Account < Base
  attribute :id, Integer
  attribute :name, String
  attribute :short_name, String
  attribute :url, String
  attribute :city, String
  attribute :country_code, String
  attribute :time_zone, String
  attribute :franchisor_id, Integer
  attribute :franchisor_name, String
  attribute :facebook_connected, Axiom::Types::Boolean
  attribute :yelp_connected, Axiom::Types::Boolean
  attribute :google_connected, Axiom::Types::Boolean

  # Retreives accounts.
  #
  # @param franchisor_id [Integer] franchisor_id to get accounts for
  # @return [Array<Rallio::Account>]
  def self.for(franchisor_id:)
    response = self.get("/franchisors/#{franchisor_id}/accounts", headers: app_credentials)
    response.parsed_response['accounts'].map { |a| new a }
  end

  # Creates an account.
  #
  # @param franchisor_id [Integer] franchisor_id to create account under
  # @param account [Hash]
  # @option account [String] :name
  # @option account [String] :short_name slug or other identifier
  # @option account [String] :url
  # @option account [String] :city
  # @option account [String] :country_code
  # @option account [String] :time_zone
  # @return [Rallio::Account] hash of account created
  def self.create(franchisor_id:, account:)
    response = self.post("/franchisors/#{franchisor_id}/accounts", headers: app_credentials, body: { account:  })
    new response.parsed_response['account']
  end

  # Retreives reviews for the account.
  #
  # @param access_token [String] user access token for API access to account
  # @return [Array<Rallio::Review>]
  def reviews(access_token:)
    Review.all(type: type, id: id, access_token: access_token)
  end

  private

  def type
    :accounts
  end
end

#yelp_connectedString

Returns yelp has been associated.

Returns:

  • (String)

    yelp has been associated



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/rallio/account.rb', line 28

class Account < Base
  attribute :id, Integer
  attribute :name, String
  attribute :short_name, String
  attribute :url, String
  attribute :city, String
  attribute :country_code, String
  attribute :time_zone, String
  attribute :franchisor_id, Integer
  attribute :franchisor_name, String
  attribute :facebook_connected, Axiom::Types::Boolean
  attribute :yelp_connected, Axiom::Types::Boolean
  attribute :google_connected, Axiom::Types::Boolean

  # Retreives accounts.
  #
  # @param franchisor_id [Integer] franchisor_id to get accounts for
  # @return [Array<Rallio::Account>]
  def self.for(franchisor_id:)
    response = self.get("/franchisors/#{franchisor_id}/accounts", headers: app_credentials)
    response.parsed_response['accounts'].map { |a| new a }
  end

  # Creates an account.
  #
  # @param franchisor_id [Integer] franchisor_id to create account under
  # @param account [Hash]
  # @option account [String] :name
  # @option account [String] :short_name slug or other identifier
  # @option account [String] :url
  # @option account [String] :city
  # @option account [String] :country_code
  # @option account [String] :time_zone
  # @return [Rallio::Account] hash of account created
  def self.create(franchisor_id:, account:)
    response = self.post("/franchisors/#{franchisor_id}/accounts", headers: app_credentials, body: { account:  })
    new response.parsed_response['account']
  end

  # Retreives reviews for the account.
  #
  # @param access_token [String] user access token for API access to account
  # @return [Array<Rallio::Review>]
  def reviews(access_token:)
    Review.all(type: type, id: id, access_token: access_token)
  end

  private

  def type
    :accounts
  end
end

Class Method Details

.create(franchisor_id:, account:) ⇒ Rallio::Account

Creates an account.

Parameters:

  • franchisor_id (Integer)

    franchisor_id to create account under

  • account (Hash)

Options Hash (account:):

  • :name (String)
  • :short_name (String)

    slug or other identifier

  • :url (String)
  • :city (String)
  • :country_code (String)
  • :time_zone (String)

Returns:



62
63
64
65
# File 'lib/rallio/account.rb', line 62

def self.create(franchisor_id:, account:)
  response = self.post("/franchisors/#{franchisor_id}/accounts", headers: app_credentials, body: { account:  })
  new response.parsed_response['account']
end

.for(franchisor_id:) ⇒ Array<Rallio::Account>

Retreives accounts.

Parameters:

  • franchisor_id (Integer)

    franchisor_id to get accounts for

Returns:



46
47
48
49
# File 'lib/rallio/account.rb', line 46

def self.for(franchisor_id:)
  response = self.get("/franchisors/#{franchisor_id}/accounts", headers: app_credentials)
  response.parsed_response['accounts'].map { |a| new a }
end

Instance Method Details

#reviews(access_token:) ⇒ Array<Rallio::Review>

Retreives reviews for the account.

Parameters:

  • access_token (String)

    user access token for API access to account

Returns:



71
72
73
# File 'lib/rallio/account.rb', line 71

def reviews(access_token:)
  Review.all(type: type, id: id, access_token: access_token)
end