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
48 def freeze
49   opts[:custom_block_results].freeze
50   super
51 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
55 def handle_block_result(klass, &block)
56   opts[:custom_block_results][klass] = define_roda_method(opts[:custom_block_results][klass] || "custom_block_result_#{klass}", 1, &block)
57 end