Sha256: 92e5cb19912010dad60914f0a55a49c585800225a41dbcabb34ada7157a8506e

Contents?: true

Size: 463 Bytes

Versions: 36

Compression:

Stored size: 463 Bytes

Contents

module Rack::App::InstanceMethods::Core

  attr_writer :request, :response

  def request
    @request || raise("request object is not set for #{self.class}")
  end

  def response
    @response || raise("response object is not set for #{self.class}")
  end

  def respond_with(value = response)
    case value
    when Rack::Response
      throw(:rack_response, value)
    else
      throw(:response_body, value)
    end
  end

  alias finish! respond_with

end

Version data entries

36 entries across 36 versions & 2 rubygems

Version Path
rack-app-8.1.0 lib/rack/app/instance_methods/core.rb
rack-app-8.0.1 lib/rack/app/instance_methods/core.rb
rack-app-8.0.0 lib/rack/app/instance_methods/core.rb
mountapi-0.11.1 vendor/bundle/ruby/2.7.0/gems/rack-app-7.7.0/lib/rack/app/instance_methods/core.rb
rack-app-7.7.0 lib/rack/app/instance_methods/core.rb
rack-app-7.6.5 lib/rack/app/instance_methods/core.rb
rack-app-7.6.4 lib/rack/app/instance_methods/core.rb
rack-app-7.6.3 lib/rack/app/instance_methods/core.rb
rack-app-7.6.2 lib/rack/app/instance_methods/core.rb
rack-app-7.6.1 lib/rack/app/instance_methods/core.rb
rack-app-7.6.0 lib/rack/app/instance_methods/core.rb
rack-app-7.5.2 lib/rack/app/instance_methods/core.rb
rack-app-7.5.1 lib/rack/app/instance_methods/core.rb
rack-app-7.5.0 lib/rack/app/instance_methods/core.rb
rack-app-7.4.0 lib/rack/app/instance_methods/core.rb
rack-app-7.3.2 lib/rack/app/instance_methods/core.rb
rack-app-7.3.1 lib/rack/app/instance_methods/core.rb
rack-app-7.3.0 lib/rack/app/instance_methods/core.rb
rack-app-7.2.2 lib/rack/app/instance_methods/core.rb
rack-app-7.2.1 lib/rack/app/instance_methods/core.rb