Class: Rallio::Franchisor
Overview
Represents an franchisor object as it comes from Rallio.
Instance Attribute Summary collapse
-
#id ⇒ Integer
Unique id for franchisor.
-
#name ⇒ String
Account name.
Class Method Summary collapse
-
.all ⇒ Array<Rallio::Franchisor>
Retreives all franchisors for a given application.
Instance Method Summary collapse
-
#accounts ⇒ Array<Rallio::Account>
Retreives all accounts for the Rallio::Franchisor.
-
#reviews(access_token:) ⇒ Array<Rallio::Review>
Retreives reviews for the franchisor.
Methods inherited from Base
Instance Attribute Details
#id ⇒ Integer
Returns unique id for franchisor.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/rallio/franchisor.rb', line 8 class Franchisor < Base attribute :id, Integer attribute :name, String # Retreives all franchisors for a given application. # # @return [Array<Rallio::Franchisor>] def self.all response = self.get('/franchisors', headers: app_credentials) response.parsed_response['franchisors'].map { |f| new(f) } end # Retreives all accounts for the Rallio::Franchisor # @see Rallio::Account # # @return [Array<Rallio::Account>] def accounts Rallio::Account.for(franchisor_id: id) end # Retreives reviews for the franchisor. # # @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 :franchisors end end |
#name ⇒ String
Returns account name.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/rallio/franchisor.rb', line 8 class Franchisor < Base attribute :id, Integer attribute :name, String # Retreives all franchisors for a given application. # # @return [Array<Rallio::Franchisor>] def self.all response = self.get('/franchisors', headers: app_credentials) response.parsed_response['franchisors'].map { |f| new(f) } end # Retreives all accounts for the Rallio::Franchisor # @see Rallio::Account # # @return [Array<Rallio::Account>] def accounts Rallio::Account.for(franchisor_id: id) end # Retreives reviews for the franchisor. # # @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 :franchisors end end |
Class Method Details
.all ⇒ Array<Rallio::Franchisor>
Retreives all franchisors for a given application.
15 16 17 18 |
# File 'lib/rallio/franchisor.rb', line 15 def self.all response = self.get('/franchisors', headers: app_credentials) response.parsed_response['franchisors'].map { |f| new(f) } end |
Instance Method Details
#accounts ⇒ Array<Rallio::Account>
Retreives all accounts for the Rallio::Franchisor
24 25 26 |
# File 'lib/rallio/franchisor.rb', line 24 def accounts Rallio::Account.for(franchisor_id: id) end |
#reviews(access_token:) ⇒ Array<Rallio::Review>
Retreives reviews for the franchisor.
32 33 34 |
# File 'lib/rallio/franchisor.rb', line 32 def reviews(access_token:) Review.all(type: type, id: id, access_token: access_token) end |