Sha256: 9bf6ee175bdf3962c86efca760317a9341879ae1caa2d7b89ca2ecb01b0ea301

Contents?: true

Size: 589 Bytes

Versions: 7

Compression:

Stored size: 589 Bytes

Contents

# -*- coding: utf-8 -*-
# stolen from okkez http://github.com/hiki/hiki/blob/rack/hiki/response.rb
module TDiary
	if Object.const_defined?(:Rack)
		Response = ::Rack::Response
	else
		class Response
			attr_reader :body, :status, :headers
			def initialize(body = [], status = 200, headers = {}, &block)
				@body = body
				@status = status
				@headers = headers
				yield self if block_given?
			end

			def finish
				[status, headers, body]
			end
			alias to_a finish
		end
	end
end

# Local Variables:
# mode: ruby
# indent-tabs-mode: t
# tab-width: 3
# ruby-indent-level: 3
# End:

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
tdiary-3.2.2.20130617 tdiary/response.rb
tdiary-3.2.2.20130614 tdiary/response.rb
tdiary-3.2.2.20130604 tdiary/response.rb
tdiary-3.2.2.20130527 tdiary/response.rb
tdiary-3.2.2.20130518 tdiary/response.rb
tdiary-3.2.2.20130508 tdiary/response.rb
tdiary-3.2.2.20130507 tdiary/response.rb