Sha256: e9e5988768b32a86174edcb65f6ba53b9a178c7775430636dd49ce1e3e650b03

Contents?: true

Size: 1.07 KB

Versions: 11

Compression:

Stored size: 1.07 KB

Contents

require 'deas/view_handler'

class TestViewHandler
  include Deas::ViewHandler

end

class RenderViewHandler
  include Deas::ViewHandler

  def run!
    render "my_template", :some => :option
  end
end

class FlagViewHandler
  include Deas::ViewHandler
  before{ @before_hook_called = true }
  after{  @after_hook_called  = true }
  layout 'web'

  attr_reader :before_init_called, :init_bang_called, :after_init_called,
    :before_run_called, :run_bang_called, :after_run_called,
    :before_hook_called, :after_hook_called, :second_before_init_called

  before_init do
    @before_init_called = true
  end
  before_init do
    @second_before_init_called = true
  end

  def init!
    @init_bang_called = true
  end

  after_init do
    @after_init_called = true
  end

  before_run do
    @before_run_called = true
  end

  def run!
    @run_bang_called = true
  end

  after_run do
    @after_run_called = true
  end

end

class HaltViewHandler
  include Deas::ViewHandler

  def run!
    halt_args = [ params['code'], params['headers'], params['body'] ].compact
    halt(*halt_args)
  end

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
deas-0.13.1 test/support/view_handlers.rb
deas-0.13.0 test/support/view_handlers.rb
deas-0.12.0 test/support/view_handlers.rb
deas-0.11.0 test/support/view_handlers.rb
deas-0.10.0 test/support/view_handlers.rb
deas-0.9.0 test/support/view_handlers.rb
deas-0.8.0 test/support/view_handlers.rb
deas-0.7.0 test/support/view_handlers.rb
deas-0.6.0 test/support/view_handlers.rb
deas-0.5.0 test/support/view_handlers.rb
deas-0.4.1 test/support/view_handlers.rb