Class: Yarr::EvaluatorService::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/yarr/evaluator_service.rb

Overview

Request that's sent to web service.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code, lang = CURRENT_RUBY) ⇒ Request

Returns a new instance of Request.


36
37
38
39
# File 'lib/yarr/evaluator_service.rb', line 36

def initialize(code, lang = CURRENT_RUBY)
  @code = code
  @lang = lang
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code


33
34
35
# File 'lib/yarr/evaluator_service.rb', line 33

def code
  @code
end

#langObject (readonly)

Returns the value of attribute lang


33
34
35
# File 'lib/yarr/evaluator_service.rb', line 33

def lang
  @lang
end

Instance Method Details

#to_wireObject

Serializes the request ready to be sent


42
43
44
45
46
47
48
# File 'lib/yarr/evaluator_service.rb', line 42

def to_wire
  { run_request: {
    language: 'ruby',
    version: @lang,
    code: @code
  } }.to_json
end