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



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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/rallio/account.rb', line 40

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 :facebook_needs_reconnection, Axiom::Types::Boolean
  attribute :facebook_reputation, Float
  attribute :yelp_connected, Axiom::Types::Boolean
  attribute :yelp_needs_reconnection, Axiom::Types::Boolean
  attribute :yelp_reputation, Float
  attribute :google_connected, Axiom::Types::Boolean
  attribute :google_needs_reconnection, Axiom::Types::Boolean
  attribute :google_reputation, Float

  # 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



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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/rallio/account.rb', line 40

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 :facebook_needs_reconnection, Axiom::Types::Boolean
  attribute :facebook_reputation, Float
  attribute :yelp_connected, Axiom::Types::Boolean
  attribute :yelp_needs_reconnection, Axiom::Types::Boolean
  attribute :yelp_reputation, Float
  attribute :google_connected, Axiom::Types::Boolean
  attribute :google_needs_reconnection, Axiom::Types::Boolean
  attribute :google_reputation, Float

  # 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_connectedBoolean

Returns facebook has been associated.

Returns:

  • (Boolean)

    facebook has been associated



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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/rallio/account.rb', line 40

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 :facebook_needs_reconnection, Axiom::Types::Boolean
  attribute :facebook_reputation, Float
  attribute :yelp_connected, Axiom::Types::Boolean
  attribute :yelp_needs_reconnection, Axiom::Types::Boolean
  attribute :yelp_reputation, Float
  attribute :google_connected, Axiom::Types::Boolean
  attribute :google_needs_reconnection, Axiom::Types::Boolean
  attribute :google_reputation, Float

  # 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_needs_reconnectionBoolean

Returns facebook has lost its connection.

Returns:

  • (Boolean)

    facebook has lost its connection



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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/rallio/account.rb', line 40

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 :facebook_needs_reconnection, Axiom::Types::Boolean
  attribute :facebook_reputation, Float
  attribute :yelp_connected, Axiom::Types::Boolean
  attribute :yelp_needs_reconnection, Axiom::Types::Boolean
  attribute :yelp_reputation, Float
  attribute :google_connected, Axiom::Types::Boolean
  attribute :google_needs_reconnection, Axiom::Types::Boolean
  attribute :google_reputation, Float

  # 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_reputationFloat

Returns average review rating for facebook.

Returns:

  • (Float)

    average review rating for facebook



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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/rallio/account.rb', line 40

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 :facebook_needs_reconnection, Axiom::Types::Boolean
  attribute :facebook_reputation, Float
  attribute :yelp_connected, Axiom::Types::Boolean
  attribute :yelp_needs_reconnection, Axiom::Types::Boolean
  attribute :yelp_reputation, Float
  attribute :google_connected, Axiom::Types::Boolean
  attribute :google_needs_reconnection, Axiom::Types::Boolean
  attribute :google_reputation, Float

  # 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



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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/rallio/account.rb', line 40

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 :facebook_needs_reconnection, Axiom::Types::Boolean
  attribute :facebook_reputation, Float
  attribute :yelp_connected, Axiom::Types::Boolean
  attribute :yelp_needs_reconnection, Axiom::Types::Boolean
  attribute :yelp_reputation, Float
  attribute :google_connected, Axiom::Types::Boolean
  attribute :google_needs_reconnection, Axiom::Types::Boolean
  attribute :google_reputation, Float

  # 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



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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/rallio/account.rb', line 40

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 :facebook_needs_reconnection, Axiom::Types::Boolean
  attribute :facebook_reputation, Float
  attribute :yelp_connected, Axiom::Types::Boolean
  attribute :yelp_needs_reconnection, Axiom::Types::Boolean
  attribute :yelp_reputation, Float
  attribute :google_connected, Axiom::Types::Boolean
  attribute :google_needs_reconnection, Axiom::Types::Boolean
  attribute :google_reputation, Float

  # 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



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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/rallio/account.rb', line 40

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 :facebook_needs_reconnection, Axiom::Types::Boolean
  attribute :facebook_reputation, Float
  attribute :yelp_connected, Axiom::Types::Boolean
  attribute :yelp_needs_reconnection, Axiom::Types::Boolean
  attribute :yelp_reputation, Float
  attribute :google_connected, Axiom::Types::Boolean
  attribute :google_needs_reconnection, Axiom::Types::Boolean
  attribute :google_reputation, Float

  # 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_needs_reconnectionBoolean

Returns google has lost its connection.

Returns:

  • (Boolean)

    google has lost its connection



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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/rallio/account.rb', line 40

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 :facebook_needs_reconnection, Axiom::Types::Boolean
  attribute :facebook_reputation, Float
  attribute :yelp_connected, Axiom::Types::Boolean
  attribute :yelp_needs_reconnection, Axiom::Types::Boolean
  attribute :yelp_reputation, Float
  attribute :google_connected, Axiom::Types::Boolean
  attribute :google_needs_reconnection, Axiom::Types::Boolean
  attribute :google_reputation, Float

  # 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_reputationFloat

Returns average review rating for google.

Returns:

  • (Float)

    average review rating for google



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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/rallio/account.rb', line 40

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 :facebook_needs_reconnection, Axiom::Types::Boolean
  attribute :facebook_reputation, Float
  attribute :yelp_connected, Axiom::Types::Boolean
  attribute :yelp_needs_reconnection, Axiom::Types::Boolean
  attribute :yelp_reputation, Float
  attribute :google_connected, Axiom::Types::Boolean
  attribute :google_needs_reconnection, Axiom::Types::Boolean
  attribute :google_reputation, Float

  # 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



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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/rallio/account.rb', line 40

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 :facebook_needs_reconnection, Axiom::Types::Boolean
  attribute :facebook_reputation, Float
  attribute :yelp_connected, Axiom::Types::Boolean
  attribute :yelp_needs_reconnection, Axiom::Types::Boolean
  attribute :yelp_reputation, Float
  attribute :google_connected, Axiom::Types::Boolean
  attribute :google_needs_reconnection, Axiom::Types::Boolean
  attribute :google_reputation, Float

  # 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



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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/rallio/account.rb', line 40

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 :facebook_needs_reconnection, Axiom::Types::Boolean
  attribute :facebook_reputation, Float
  attribute :yelp_connected, Axiom::Types::Boolean
  attribute :yelp_needs_reconnection, Axiom::Types::Boolean
  attribute :yelp_reputation, Float
  attribute :google_connected, Axiom::Types::Boolean
  attribute :google_needs_reconnection, Axiom::Types::Boolean
  attribute :google_reputation, Float

  # 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



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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/rallio/account.rb', line 40

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 :facebook_needs_reconnection, Axiom::Types::Boolean
  attribute :facebook_reputation, Float
  attribute :yelp_connected, Axiom::Types::Boolean
  attribute :yelp_needs_reconnection, Axiom::Types::Boolean
  attribute :yelp_reputation, Float
  attribute :google_connected, Axiom::Types::Boolean
  attribute :google_needs_reconnection, Axiom::Types::Boolean
  attribute :google_reputation, Float

  # 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



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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/rallio/account.rb', line 40

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 :facebook_needs_reconnection, Axiom::Types::Boolean
  attribute :facebook_reputation, Float
  attribute :yelp_connected, Axiom::Types::Boolean
  attribute :yelp_needs_reconnection, Axiom::Types::Boolean
  attribute :yelp_reputation, Float
  attribute :google_connected, Axiom::Types::Boolean
  attribute :google_needs_reconnection, Axiom::Types::Boolean
  attribute :google_reputation, Float

  # 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



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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/rallio/account.rb', line 40

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 :facebook_needs_reconnection, Axiom::Types::Boolean
  attribute :facebook_reputation, Float
  attribute :yelp_connected, Axiom::Types::Boolean
  attribute :yelp_needs_reconnection, Axiom::Types::Boolean
  attribute :yelp_reputation, Float
  attribute :google_connected, Axiom::Types::Boolean
  attribute :google_needs_reconnection, Axiom::Types::Boolean
  attribute :google_reputation, Float

  # 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



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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/rallio/account.rb', line 40

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 :facebook_needs_reconnection, Axiom::Types::Boolean
  attribute :facebook_reputation, Float
  attribute :yelp_connected, Axiom::Types::Boolean
  attribute :yelp_needs_reconnection, Axiom::Types::Boolean
  attribute :yelp_reputation, Float
  attribute :google_connected, Axiom::Types::Boolean
  attribute :google_needs_reconnection, Axiom::Types::Boolean
  attribute :google_reputation, Float

  # 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_needs_reconnectionBoolean

Returns yelp has lost its connection.

Returns:

  • (Boolean)

    yelp has lost its connection



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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/rallio/account.rb', line 40

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 :facebook_needs_reconnection, Axiom::Types::Boolean
  attribute :facebook_reputation, Float
  attribute :yelp_connected, Axiom::Types::Boolean
  attribute :yelp_needs_reconnection, Axiom::Types::Boolean
  attribute :yelp_reputation, Float
  attribute :google_connected, Axiom::Types::Boolean
  attribute :google_needs_reconnection, Axiom::Types::Boolean
  attribute :google_reputation, Float

  # 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_reputationFloat

Returns average review rating for yelp.

Returns:

  • (Float)

    average review rating for yelp



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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/rallio/account.rb', line 40

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 :facebook_needs_reconnection, Axiom::Types::Boolean
  attribute :facebook_reputation, Float
  attribute :yelp_connected, Axiom::Types::Boolean
  attribute :yelp_needs_reconnection, Axiom::Types::Boolean
  attribute :yelp_reputation, Float
  attribute :google_connected, Axiom::Types::Boolean
  attribute :google_needs_reconnection, Axiom::Types::Boolean
  attribute :google_reputation, Float

  # 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:



80
81
82
83
# File 'lib/rallio/account.rb', line 80

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:



64
65
66
67
# File 'lib/rallio/account.rb', line 64

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:



89
90
91
# File 'lib/rallio/account.rb', line 89

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