Module: LearnWeb::Client::Event

Included in:
LearnWeb::Client
Defined in:
lib/learn_web/client/event.rb,
lib/learn_web/client/event/submission.rb

Defined Under Namespace

Classes: Submission

Constant Summary collapse

IRONBROKER_URL =
'http://ironbroker-v2.flatironschool.com'

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



6
7
8
# File 'lib/learn_web/client/event.rb', line 6

def client
  @client
end

Instance Method Details

#submission_endpointObject



16
17
18
# File 'lib/learn_web/client/event.rb', line 16

def submission_endpoint
  '/e/learn_gem'
end

#submit_event(params) ⇒ Object



20
21
22
23
24
25
26
27
28
# File 'lib/learn_web/client/event.rb', line 20

def submit_event(params)
  response = post(
    submission_endpoint,
    body: params,
    client: client
  )

  LearnWeb::Client::Event::Submission.new(response)
end