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.
-
#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.
Class Method Summary collapse
-
.create(franchisor_id:, payload:) ⇒ Hash
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
18 19 20 21 22 23 24 25 26 27 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 |
# File 'lib/rallio/account.rb', line 18 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 # 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 payload [Hash] # @option payload [Hash] :account data to create account with # @return [Hash] hash of account created def self.create(franchisor_id:, payload:) self.post("/franchisors/#{franchisor_id}/accounts", headers: app_credentials, body: payload).parsed_response 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
18 19 20 21 22 23 24 25 26 27 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 |
# File 'lib/rallio/account.rb', line 18 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 # 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 payload [Hash] # @option payload [Hash] :account data to create account with # @return [Hash] hash of account created def self.create(franchisor_id:, payload:) self.post("/franchisors/#{franchisor_id}/accounts", headers: app_credentials, body: payload).parsed_response 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
18 19 20 21 22 23 24 25 26 27 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 |
# File 'lib/rallio/account.rb', line 18 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 # 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 payload [Hash] # @option payload [Hash] :account data to create account with # @return [Hash] hash of account created def self.create(franchisor_id:, payload:) self.post("/franchisors/#{franchisor_id}/accounts", headers: app_credentials, body: payload).parsed_response 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
18 19 20 21 22 23 24 25 26 27 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 |
# File 'lib/rallio/account.rb', line 18 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 # 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 payload [Hash] # @option payload [Hash] :account data to create account with # @return [Hash] hash of account created def self.create(franchisor_id:, payload:) self.post("/franchisors/#{franchisor_id}/accounts", headers: app_credentials, body: payload).parsed_response 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
18 19 20 21 22 23 24 25 26 27 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 |
# File 'lib/rallio/account.rb', line 18 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 # 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 payload [Hash] # @option payload [Hash] :account data to create account with # @return [Hash] hash of account created def self.create(franchisor_id:, payload:) self.post("/franchisors/#{franchisor_id}/accounts", headers: app_credentials, body: payload).parsed_response 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
18 19 20 21 22 23 24 25 26 27 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 |
# File 'lib/rallio/account.rb', line 18 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 # 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 payload [Hash] # @option payload [Hash] :account data to create account with # @return [Hash] hash of account created def self.create(franchisor_id:, payload:) self.post("/franchisors/#{franchisor_id}/accounts", headers: app_credentials, body: payload).parsed_response 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
18 19 20 21 22 23 24 25 26 27 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 |
# File 'lib/rallio/account.rb', line 18 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 # 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 payload [Hash] # @option payload [Hash] :account data to create account with # @return [Hash] hash of account created def self.create(franchisor_id:, payload:) self.post("/franchisors/#{franchisor_id}/accounts", headers: app_credentials, body: payload).parsed_response 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:, payload:) ⇒ Hash
Creates an account.
42 43 44 |
# File 'lib/rallio/account.rb', line 42 def self.create(franchisor_id:, payload:) self.post("/franchisors/#{franchisor_id}/accounts", headers: app_credentials, body: payload).parsed_response end |
.for(franchisor_id:) ⇒ Array<Rallio::Account>
Retreives accounts.
31 32 33 34 |
# File 'lib/rallio/account.rb', line 31 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.
50 51 52 |
# File 'lib/rallio/account.rb', line 50 def reviews(access_token:) Review.all(type: type, id: id, access_token: access_token) end |