Class: PlainRouter::Client
- Inherits:
-
Object
- Object
- PlainRouter::Client
- Defined in:
- lib/plainrouter/client.rb
Overview
Compact entry point for the PlainRouter API.
Instance Attribute Summary collapse
-
#events ⇒ Object
readonly
Returns the value of attribute events.
-
#operations ⇒ Object
readonly
Returns the value of attribute operations.
-
#sandbox ⇒ Object
readonly
Returns the value of attribute sandbox.
Instance Method Summary collapse
-
#initialize(token: nil, base_url: DEFAULT_BASE_URL, timeout: 30, user_agent: nil) {|configuration| ... } ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(token: nil, base_url: DEFAULT_BASE_URL, timeout: 30, user_agent: nil) {|configuration| ... } ⇒ Client
Returns a new instance of Client.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/plainrouter/client.rb', line 10 def initialize(token: nil, base_url: DEFAULT_BASE_URL, timeout: 30, user_agent: nil) configuration = OpenAPI::Configuration.new configure_base_url(configuration, base_url) configuration.access_token = token configuration.timeout = timeout yield configuration if block_given? api_client = OpenAPI::ApiClient.new(configuration) api_client.user_agent = user_agent || "plainrouter-ruby/#{VERSION}" @events = OpenAPI::EventApi.new(api_client) @operations = OpenAPI::OperationsApi.new(api_client) @sandbox = OpenAPI::SandboxApi.new(api_client) end |
Instance Attribute Details
#events ⇒ Object (readonly)
Returns the value of attribute events.
8 9 10 |
# File 'lib/plainrouter/client.rb', line 8 def events @events end |
#operations ⇒ Object (readonly)
Returns the value of attribute operations.
8 9 10 |
# File 'lib/plainrouter/client.rb', line 8 def operations @operations end |
#sandbox ⇒ Object (readonly)
Returns the value of attribute sandbox.
8 9 10 |
# File 'lib/plainrouter/client.rb', line 8 def sandbox @sandbox end |