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
Returns the value of attribute session_id.
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.
14 15 16 |
# File 'lib/ruby_drills/sessions/collector_client.rb', line 14 def initialize @session_id = SecureRandom.urlsafe_base64 end |
Instance Attribute Details
#session_id ⇒ Object (readonly)
Returns the value of attribute session_id.
12 13 14 |
# File 'lib/ruby_drills/sessions/collector_client.rb', line 12 def session_id @session_id end |
Instance Method Details
#attempt(name, input, reference, result) ⇒ Object
22 23 24 |
# File 'lib/ruby_drills/sessions/collector_client.rb', line 22 def attempt(name, input, reference, result) store({context: name, input: input, reference: reference, result: result, type: 'attempt'}) end |
#command(name, input) ⇒ Object
18 19 20 |
# File 'lib/ruby_drills/sessions/collector_client.rb', line 18 def command(name, input) store({context: name, input: input, type: 'command'}) end |