Class: Rallio::Account
Overview
Represents an account object as it comes from Rallio.
Instance Attribute Summary collapse
-
#city ⇒ String
Account city.
-
#country_code ⇒ String
Account country code.
-
#facebook_connected ⇒ String
Facebook has been associated.
-
#franchisor_id ⇒ String
Franchisor_id account belongs to.
-
#franchisor_name ⇒ String
Franchisor_name account belongs to.
-
#google_connected ⇒ String
Google has been associated.
-
#id ⇒ Integer
Unique id for account.
-
#name ⇒ String
Account name.
-
#short_name ⇒ String
Account short name.
-
#time_zone ⇒ String
Account time zone.
-
#url ⇒ String
Account url.
-
#yelp_connected ⇒ String
Yelp has been associated.
Class Method Summary collapse
-
.create(franchisor_id:, account:) ⇒ Rallio::Account
Creates an account.
-
.for(franchisor_id:) ⇒ Array<Rallio::Account>
Retreives accounts.
Instance Method Summary collapse
-
#reviews(access_token:) ⇒ Array<Rallio::Review>
Retreives reviews for the account.
Methods inherited from Base
Instance Attribute Details
#city ⇒ String
Returns 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: 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_code ⇒ String
Returns 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: 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_connected ⇒ String
Returns 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: 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_id ⇒ String
Returns 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: 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_name ⇒ String
Returns 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: 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_connected ⇒ String
Returns 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: 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 |
#id ⇒ Integer
Returns 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: 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 |
#name ⇒ String
Returns 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: 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_name ⇒ String
Returns 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: 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_zone ⇒ String
Returns 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: 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 |
#url ⇒ String
Returns 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: 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_connected ⇒ String
Returns 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: 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.
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: account }) new response.parsed_response['account'] end |
.for(franchisor_id:) ⇒ Array<Rallio::Account>
Retreives accounts.
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.
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 |