Class: SocketLabs::InjectionApi::Core::InjectionRequestFactory
- Inherits:
-
Object
- Object
- SocketLabs::InjectionApi::Core::InjectionRequestFactory
- Defined in:
- lib/socketlabs/injectionapi/core/injection_request_factory.rb
Constant Summary
Constants included from SocketLabs::InjectionApi
Instance Attribute Summary collapse
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
-
#server_id ⇒ Object
readonly
Returns the value of attribute server_id.
Instance Method Summary collapse
-
#generate_request(message) ⇒ InjectionRequest
Generate the InjectionRequest for sending to the Injection Api.
-
#initialize(server_id, api_key) ⇒ String
constructor
Creates a new instance of the InjectionRequestFactory.
Constructor Details
#initialize(server_id, api_key) ⇒ String
Creates a new instance of the InjectionRequestFactory.
29 30 31 32 33 34 |
# File 'lib/socketlabs/injectionapi/core/injection_request_factory.rb', line 29 def initialize(server_id, api_key) @server_id = server_id @api_key = api_key end |
Instance Attribute Details
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
24 25 26 |
# File 'lib/socketlabs/injectionapi/core/injection_request_factory.rb', line 24 def api_key @api_key end |
#server_id ⇒ Object (readonly)
Returns the value of attribute server_id.
23 24 25 |
# File 'lib/socketlabs/injectionapi/core/injection_request_factory.rb', line 23 def server_id @server_id end |
Instance Method Details
#generate_request(message) ⇒ InjectionRequest
Generate the InjectionRequest for sending to the Injection Api.
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/socketlabs/injectionapi/core/injection_request_factory.rb', line 39 def generate_request() request = InjectionRequest.new if .instance_of? BasicMessage request = () end if .instance_of? BulkMessage request = () end request end |