Module: WeConnect

Extended by:
WrAPI::Configuration, WrAPI::RespondTo
Defined in:
lib/weconnect.rb,
lib/weconnect/api.rb,
lib/weconnect/const.rb,
lib/weconnect/error.rb,
lib/weconnect/client.rb,
lib/weconnect/request.rb,
lib/weconnect/version.rb,
lib/weconnect/connection.rb,
lib/weconnect/pagination.rb,
lib/weconnect/authorization.rb,
lib/weconnect/control_operation.rb

Defined Under Namespace

Modules: Authentication, Connection, Control, Request, RequestPagination Classes: API, AllDomains, AuthenticationError, Badge, BrandCode, Client, ConfigurationError, DevicePlatform, EnrollmentStatus, Enum, ExternalPower, IncompatibleAPIError, JobDomain, LedColor, PlugConnectionState, PlugLockState, Role, Status, TripType, UserRoleStatus, WeConnectError, WeconnectAuthenticated

Constant Summary collapse

DEFAULT_UA =
"WeConnect/3 CFNetwork/1331.0.7 Darwin/21.4.0 Ruby WeConnect Client #{WeConnect::VERSION}".freeze
DEFAULT_ENDPOINT =
'https://emea.bff.cariad.digital/login/v1/idk/openid-configuration'.freeze
VERSION =
'0.1.0'

Class Method Summary collapse

Class Method Details

.client(options = {}) ⇒ WeConnect::Client

Returns:



14
15
16
# File 'lib/weconnect.rb', line 14

def self.client(options = {})
  WeConnect::Client.new({ user_agent: DEFAULT_UA, endpoint: DEFAULT_ENDPOINT, pagination_class: RequestPagination::DefaultPager }.merge(options))
end

.resetObject



18
19
20
21
22
23
# File 'lib/weconnect.rb', line 18

def self.reset
  super
  self.user_agent = DEFAULT_UA
  self.endpoint   = DEFAULT_ENDPOINT
  self.pagination_class = RequestPagination::DefaultPager
end