class Rallio::Franchisor

Represents an franchisor object as it comes from Rallio.

@!attribute [rw] id

@return [Integer] unique id for franchisor

@!attribute [rw] name

@return [String] account name

Public Class Methods

all() click to toggle source

Retreives all franchisors for a given application.

@return [Array<Rallio::Franchisor>]

# 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

Public Instance Methods

accounts() click to toggle source

Retreives all accounts for the Rallio::Franchisor @see Rallio::Account

@return [Array<Rallio::Account>]

# File lib/rallio/franchisor.rb, line 24
def accounts
  Rallio::Account.for(franchisor_id: id)
end
reviews(access_token:) click to toggle source

Retreives reviews for the franchisor.

@param access_token [String] user access token for API access to account @return [Array<Rallio::Review>]

# File lib/rallio/franchisor.rb, line 32
def reviews(access_token:)
  Review.all(type: type, id: id, access_token: access_token)
end

Private Instance Methods

type() click to toggle source
# File lib/rallio/franchisor.rb, line 38
def type
  :franchisors
end