Class: Sessions::CollectorClient
- Inherits:
-
Object
- Object
- Sessions::CollectorClient
- Includes:
- HTTParty
- Defined in:
- lib/ruby_drills/sessions/collector_client.rb
Instance Attribute Summary collapse
-
#session_id ⇒ Object
readonly
base_uri ‘localhost:9091’ debug_output $stderr.
Instance Method Summary collapse
- #attempt(name, input, reference, result) ⇒ Object
- #command(name, input) ⇒ Object
-
#initialize ⇒ CollectorClient
constructor
A new instance of CollectorClient.
Constructor Details
#initialize ⇒ CollectorClient
Returns a new instance of CollectorClient.
13 14 15 |
# File 'lib/ruby_drills/sessions/collector_client.rb', line 13 def initialize @session_id = SecureRandom.urlsafe_base64 end |
Instance Attribute Details
#session_id ⇒ Object (readonly)
base_uri ‘localhost:9091’ debug_output $stderr
11 12 13 |
# File 'lib/ruby_drills/sessions/collector_client.rb', line 11 def session_id @session_id end |
Instance Method Details
#attempt(name, input, reference, result) ⇒ Object
21 22 23 |
# File 'lib/ruby_drills/sessions/collector_client.rb', line 21 def attempt(name, input, reference, result) store({context: name, input: input, reference: reference, result: result, type: 'attempt'}) end |
#command(name, input) ⇒ Object
17 18 19 |
# File 'lib/ruby_drills/sessions/collector_client.rb', line 17 def command(name, input) store({context: name, input: input, type: 'command'}) end |