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.
31 32 33 34 35 36 |
# File 'lib/socketlabs/injectionapi/core/injection_request_factory.rb', line 31 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.
26 27 28 |
# File 'lib/socketlabs/injectionapi/core/injection_request_factory.rb', line 26 def api_key @api_key end |
#server_id ⇒ Object (readonly)
Returns the value of attribute server_id.
25 26 27 |
# File 'lib/socketlabs/injectionapi/core/injection_request_factory.rb', line 25 def server_id @server_id end |
Instance Method Details
#generate_request(message) ⇒ InjectionRequest
Generate the InjectionRequest for sending to the Injection Api.
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/socketlabs/injectionapi/core/injection_request_factory.rb', line 41 def generate_request() request = InjectionRequest.new if .instance_of? BasicMessage request = () end if .instance_of? BulkMessage request = () end request end |