Module: Gobstones::WithRenderer
- Included in:
- Checker
- Defined in:
- lib/render/with_renderer.rb
Instance Method Summary collapse
Instance Method Details
#render_error_output(_output, error) ⇒ Object
11 12 13 14 |
# File 'lib/render/with_renderer.rb', line 11 def render_error_output(_output, error) report = error.parse_as_json renderer.send "render_error_#{report[:status]}", report[:result] end |
#render_success_output(output) ⇒ Object
3 4 5 6 7 8 9 |
# File 'lib/render/with_renderer.rb', line 3 def render_success_output(output) result = output[:result] renderer.render_success initial: result[:initialBoard], final: result[:finalBoard] || 'boom', reason: result[:finalBoardError] end |