Class: Bloodbath::Adapters::Rest
- Inherits:
-
Object
- Object
- Bloodbath::Adapters::Rest
- Includes:
- Utils::Threading
- Defined in:
- lib/bloodbath/event.rb
Constant Summary
Constants included from Utils::Threading
Utils::Threading::MAX_ACTIVE_THREADS
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#endpoint ⇒ Object
readonly
Returns the value of attribute endpoint.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(method:, endpoint:, body: nil, options:, config: Bloodbath.config) ⇒ Rest
constructor
A new instance of Rest.
- #perform ⇒ Object
Methods included from Utils::Threading
Constructor Details
#initialize(method:, endpoint:, body: nil, options:, config: Bloodbath.config) ⇒ Rest
Returns a new instance of Rest.
17 18 19 20 21 22 23 |
# File 'lib/bloodbath/event.rb', line 17 def initialize(method:, endpoint:, body: nil, options:, config: Bloodbath.config) @method = method @endpoint = endpoint @body = body @options = @config = config end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
15 16 17 |
# File 'lib/bloodbath/event.rb', line 15 def body @body end |
#config ⇒ Object (readonly)
Returns the value of attribute config.
15 16 17 |
# File 'lib/bloodbath/event.rb', line 15 def config @config end |
#endpoint ⇒ Object (readonly)
Returns the value of attribute endpoint.
15 16 17 |
# File 'lib/bloodbath/event.rb', line 15 def endpoint @endpoint end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
15 16 17 |
# File 'lib/bloodbath/event.rb', line 15 def method @method end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
15 16 17 |
# File 'lib/bloodbath/event.rb', line 15 def @options end |
Instance Method Details
#perform ⇒ Object
25 26 27 28 29 30 31 32 33 |
# File 'lib/bloodbath/event.rb', line 25 def perform check_api_key if [:wait_for_response] synchronous_call_with_response else asynchronously { synchronous_call_with_response } end end |