Module: SparkApi

Extended by:
Configuration, MultiClient
Defined in:
lib/spark_api/version.rb,
lib/spark_api.rb,
lib/spark_api/cli.rb,
lib/spark_api/client.rb,
lib/spark_api/errors.rb,
lib/spark_api/models.rb,
lib/spark_api/request.rb,
lib/spark_api/paginate.rb,
lib/spark_api/response.rb,
lib/spark_api/cli/setup.rb,
lib/spark_api/connection.rb,
lib/spark_api/models/idx.rb,
lib/spark_api/models/base.rb,
lib/spark_api/models/note.rb,
lib/spark_api/models/rule.rb,
lib/spark_api/models/sort.rb,
lib/spark_api/models/dirty.rb,
lib/spark_api/models/media.rb,
lib/spark_api/models/photo.rb,
lib/spark_api/models/video.rb,
lib/spark_api/multi_client.rb,
lib/spark_api/options_hash.rb,
lib/spark_api/configuration.rb,
lib/spark_api/models/fields.rb,
lib/spark_api/models/portal.rb,
lib/spark_api/primary_array.rb,
lib/spark_api/authentication.rb,
lib/spark_api/models/account.rb,
lib/spark_api/models/comment.rb,
lib/spark_api/models/contact.rb,
lib/spark_api/models/finders.rb,
lib/spark_api/models/floplan.rb,
lib/spark_api/models/listing.rb,
lib/spark_api/models/message.rb,
lib/spark_api/models/activity.rb,
lib/spark_api/models/concerns.rb,
lib/spark_api/models/document.rb,
lib/spark_api/models/idx_link.rb,
lib/spark_api/models/newsfeed.rb,
lib/spark_api/models/constraint.rb,
lib/spark_api/models/email_link.rb,
lib/spark_api/models/open_house.rb,
lib/spark_api/configuration/yaml.rb,
lib/spark_api/faraday_middleware.rb,
lib/spark_api/models/defaultable.rb,
lib/spark_api/models/shared_link.rb,
lib/spark_api/models/subresource.rb,
lib/spark_api/models/system_info.rb,
lib/spark_api/models/vow_account.rb,
lib/spark_api/models/listing_cart.rb,
lib/spark_api/models/notification.rb,
lib/spark_api/models/saved_search.rb,
lib/spark_api/models/tour_of_home.rb,
lib/spark_api/models/virtual_tour.rb,
lib/spark_api/models/connect_prefs.rb,
lib/spark_api/models/custom_fields.rb,
lib/spark_api/authentication/oauth2.rb,
lib/spark_api/models/account_report.rb,
lib/spark_api/models/account_roster.rb,
lib/spark_api/models/news_feed_meta.rb,
lib/spark_api/models/property_types.rb,
lib/spark_api/models/shared_listing.rb,
lib/spark_api/models/rental_calendar.rb,
lib/spark_api/models/standard_fields.rb,
lib/spark_api/authentication/api_auth.rb,
lib/spark_api/models/concerns/savable.rb,
lib/spark_api/reso_faraday_middleware.rb,
lib/spark_api/authentication/base_auth.rb,
lib/spark_api/models/market_statistics.rb,
lib/spark_api/models/incomplete_listing.rb,
lib/spark_api/models/system_info_search.rb,
lib/spark_api/models/portal_listing_cart.rb,
lib/spark_api/models/concerns/destroyable.rb,
lib/spark_api/models/listing_meta_translations.rb,
lib/spark_api/configuration/oauth2_configurable.rb,
lib/spark_api/models/search_template/quick_search.rb,
lib/spark_api/authentication/oauth2_impl/cli_provider.rb,
lib/spark_api/authentication/oauth2_impl/grant_type_base.rb,
lib/spark_api/authentication/oauth2_impl/grant_type_code.rb,
lib/spark_api/authentication/oauth2_impl/simple_provider.rb,
lib/spark_api/authentication/oauth2_impl/faraday_middleware.rb,
lib/spark_api/authentication/oauth2_impl/grant_type_refresh.rb,
lib/spark_api/authentication/oauth2_impl/grant_type_password.rb,
lib/spark_api/authentication/oauth2_impl/single_session_provider.rb

Overview

Pagination for api resource collections

Will paginate adapter for the api client. Utilizes the same interface as will paginate and returns the same WillPaginate::Collection for finder results.

Defined Under Namespace

Modules: Authentication, CLI, Configuration, Connection, Errors, Models, MultiClient, Paginate, PaginateHelper, PaginateResponse, Primary, Request, Response, ResponseCodes Classes: ApiResponse, BadResourceRequest, Client, ClientError, FaradayMiddleware, InvalidResponse, NotAllowed, NotFound, OptionsHash, Pagination, PermissionDenied, PrimaryArray, ResoFaradayMiddleware

Constant Summary collapse

VERSION =
File.read(File.dirname(__FILE__) + "/../../VERSION").chomp

Constants included from Configuration

Configuration::DEFAULT_ACCESS_URI, Configuration::DEFAULT_API_KEY, Configuration::DEFAULT_API_SECRET, Configuration::DEFAULT_API_USER, Configuration::DEFAULT_AUTHORIZATION_URI, Configuration::DEFAULT_AUTH_ENDPOINT, Configuration::DEFAULT_COMPRESS, Configuration::DEFAULT_DICTIONARY_VERSION, Configuration::DEFAULT_ENDPOINT, Configuration::DEFAULT_MIDDLEWARE, Configuration::DEFAULT_OAUTH2, Configuration::DEFAULT_REDIRECT_URI, Configuration::DEFAULT_REQUEST_ID_CHAIN, Configuration::DEFAULT_SESSION_PATH, Configuration::DEFAULT_SSL, Configuration::DEFAULT_SSL_VERIFY, Configuration::DEFAULT_TIMEOUT, Configuration::DEFAULT_USER_AGENT, Configuration::DEFAULT_USER_IP_ADDRESS, Configuration::DEFAULT_VERSION, Configuration::OAUTH2_KEYS, Configuration::VALID_OPTION_KEYS, Configuration::X_SPARK_API_USER_AGENT, Configuration::X_USER_IP_ADDRESS

Class Method Summary collapse

Methods included from Configuration

configure, extended, options, reset_configuration

Methods included from Configuration::OAuth2Configurable

#convert_to_oauth2?, #grant_uri, #oauth2_enabled?, #oauthify!

Methods included from MultiClient

activate

Class Method Details

.client(opts = {}) ⇒ Object

:nocov:



40
41
42
# File 'lib/spark_api.rb', line 40

def self.client(opts={})
  Thread.current[:spark_api_client] ||= SparkApi::Client.new(opts)
end

.loggerObject

:nocov:



27
28
29
30
31
32
33
# File 'lib/spark_api.rb', line 27

def self.logger
  if @logger.nil?
    @logger = Logger.new(STDOUT)
    @logger.level = Logger::INFO
  end
  @logger
end

.logger=(logger) ⇒ Object



35
36
37
# File 'lib/spark_api.rb', line 35

def self.logger= logger
  @logger = logger
end

.method_missing(method, *args, &block) ⇒ Object



44
45
46
47
# File 'lib/spark_api.rb', line 44

def self.method_missing(method, *args, &block)
  return super unless (client.respond_to?(method))
  client.send(method, *args, &block)
end

.resetObject



49
50
51
52
# File 'lib/spark_api.rb', line 49

def self.reset
  reset_configuration
  Thread.current[:spark_api_client] = nil
end