Sha256: dc746213a2fa0bfed02113af247409e5ca2d202412a30a8d7d80b04e76f8907a

Contents?: true

Size: 730 Bytes

Versions: 23

Compression:

Stored size: 730 Bytes

Contents

module Gobstones
  module WithRenderer
    def render_success_output(output)
      result = output[:result]

      renderer.render_success initial: result[:initialBoard],
                              final: result[:finalBoard] || 'boom',
                              reason: result[:finalBoardError]
    end

    def build_error_output(builder, example, _, error)
      error.details.deep_symbolize_keys!

      builder.result          = renderer.send "render_error_#{error.message}", error.details
      builder.summary_type    = error.message
      builder.summary_message = I18n.t error.message, error.details
    end

    private

    def renderer
      @renderer ||= Gobstones::HtmlRenderer.new(@options)
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
mumuki-gobstones-runner-2.19.0 lib/render/with_renderer.rb
mumuki-gobstones-runner-2.18.0 lib/render/with_renderer.rb
mumuki-gobstones-runner-2.17.0 lib/render/with_renderer.rb
mumuki-gobstones-runner-2.16.0 lib/render/with_renderer.rb
mumuki-gobstones-runner-2.14.3 lib/render/with_renderer.rb
mumuki-gobstones-runner-2.15.0 lib/render/with_renderer.rb
mumuki-gobstones-runner-2.14.2 lib/render/with_renderer.rb
mumuki-gobstones-runner-2.14.1 lib/render/with_renderer.rb
mumuki-gobstones-runner-2.14.0 lib/render/with_renderer.rb
mumuki-gobstones-runner-2.13.0 lib/render/with_renderer.rb
mumuki-gobstones-runner-2.12.1 lib/render/with_renderer.rb
mumuki-gobstones-runner-2.12.0 lib/render/with_renderer.rb
mumuki-gobstones-runner-2.11.0 lib/render/with_renderer.rb
mumuki-gobstones-runner-2.10.1 lib/render/with_renderer.rb
mumuki-gobstones-runner-2.10.0 lib/render/with_renderer.rb
mumuki-gobstones-runner-2.9.1 lib/render/with_renderer.rb
mumuki-gobstones-runner-2.9.0 lib/render/with_renderer.rb
mumuki-gobstones-runner-2.8.5 lib/render/with_renderer.rb
mumuki-gobstones-runner-2.8.4 lib/render/with_renderer.rb
mumuki-gobstones-runner-2.8.3 lib/render/with_renderer.rb