module Roda::RodaPlugins::CustomBlockResults::ClassMethods

  1. lib/roda/plugins/custom_block_results.rb

Methods

Public Instance

  1. freeze
  2. handle_block_result

Public Instance methods

freeze()

Freeze the configured custom block results when freezing the app.

[show source]
   # File lib/roda/plugins/custom_block_results.rb
39 def freeze
40   opts[:custom_block_results].freeze
41   super
42 end
handle_block_result(klass, &block)

Specify a block that will be called when an instance of klass is returned as a block result. The block defines a method.

[show source]
   # File lib/roda/plugins/custom_block_results.rb
46 def handle_block_result(klass, &block)
47   opts[:custom_block_results][klass] = define_roda_method(opts[:custom_block_results][klass] || "custom_block_result_#{klass}", 1, &block)
48 end