Class: FreshService::Client
- Inherits:
-
Object
- Object
- FreshService::Client
- Includes:
- V2::Group::Create, V2::Group::View, V2::ServiceRequest::Create, V2::ServiceRequest::Update, V2::Ticket::Create, V2::Ticket::Update, V2::Ticket::View, Configurable, Connection, Default
- Defined in:
- lib/fresh_service/client.rb,
lib/fresh_service/client/v2/group/view.rb,
lib/fresh_service/client/v2/ticket/view.rb,
lib/fresh_service/client/v2/group/create.rb,
lib/fresh_service/client/v2/ticket/create.rb,
lib/fresh_service/client/v2/ticket/update.rb,
lib/fresh_service/client/v2/service_request/create.rb,
lib/fresh_service/client/v2/service_request/update.rb
Overview
Client for the FreshService API
Defined Under Namespace
Modules: V2
Constant Summary
Constants included from Connection
FreshService::Connection::RETRY_HTTP_CODES
Instance Attribute Summary
Attributes included from Configurable
#api_endpoint, #api_key, #content_type, #env, #organisation, #user_agent
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Client
constructor
A new instance of Client.
Methods included from V2::ServiceRequest::Update
Methods included from V2::ServiceRequest::Create
Methods included from V2::Group::View
Methods included from V2::Group::Create
Methods included from V2::Ticket::View
Methods included from V2::Ticket::Update
Methods included from V2::Ticket::Create
Methods included from Configurable
#configure, keys, #reset!, #same_options?
Methods included from Connection
Methods included from Default
api_endpoint, api_key, api_version_url, content_type, env, options, organisation, user_agent
Constructor Details
#initialize(options = {}) ⇒ Client
Returns a new instance of Client.
31 32 33 34 35 36 37 38 |
# File 'lib/fresh_service/client.rb', line 31 def initialize( = {}) # Use options passed in, but fall back to module defaults FreshService::Configurable.keys.each do |key| value = .key?(key) ? [key] : FreshService.instance_variable_get(:"@#{key}") value = value.presence || FreshService::Default.send(:"#{key}") instance_variable_set(:"@#{key}", value) end end |