Sha256: f1c68fae24f56cdca9fb8d39358ddd60acbc9d977eb5a29f434d0d800b37d7d6

Contents?: true

Size: 783 Bytes

Versions: 1

Compression:

Stored size: 783 Bytes

Contents

require 'lotus/router'
require 'lotus/controller'
require 'lotus/view'

# FIXME Ideally, this should be done like this:
#
# module Lotus
#   module Frameworks
#     module Action
#       module Rack
#         protected
#         def response
#           [super, self].flatten
#         end
#       end
#     end
#   end
# end
#
# Lotus::Action::Rack.class_eval do
#   include Lotus::Frameworks::Action::Rack
# end
#
# ..but it doesn't work and I want to ship it!

Lotus::Action::Rack.class_eval do
  DEFAULT_RESPONSE_CODE = 200
  DEFAULT_RESPONSE_BODY = []

  protected
  def response
    [ @_status || DEFAULT_RESPONSE_CODE, headers, @_body || DEFAULT_RESPONSE_BODY.dup, self ]
  end
end

Lotus::Action.class_eval do
  def to_rendering
    exposures.merge(format: format)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
lotusrb-0.1.0 lib/lotus/frameworks.rb