Sha256: 2e05dc1b73ad17c7b1cfbabcb8ae1a6d6d80da7e186e76802c704514ebb0c6df

Contents?: true

Size: 637 Bytes

Versions: 8

Compression:

Stored size: 637 Bytes

Contents

module Padrino
  module Helpers
    module OutputHelpers
      ##
      # Handler for Haml templates.
      #
      class HamlHandler < AbstractHandler
        ##
        # Returns true if the block is for Haml
        #
        def engine_matches?(block)
          template.block_is_haml?(block)
        end

        ##
        # Captures the html from a block of template code for this handler.
        #
        def capture_from_template(*args, &block)
          engine_matches?(block) ? template.capture_haml(*args, &block) : block.call(*args)
        end
      end
      OutputHelpers.register(:haml, HamlHandler)
    end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
padrino-helpers-0.12.3 lib/padrino-helpers/output_helpers/haml_handler.rb
padrino-helpers-cj-0.12.2 lib/padrino-helpers/output_helpers/haml_handler.rb
padrino-helpers-0.12.2 lib/padrino-helpers/output_helpers/haml_handler.rb
padrino-helpers-0.12.1 lib/padrino-helpers/output_helpers/haml_handler.rb
padrino-helpers-0.12.0 lib/padrino-helpers/output_helpers/haml_handler.rb
padrino-helpers-0.12.0.rc3 lib/padrino-helpers/output_helpers/haml_handler.rb
padrino-helpers-0.12.0.rc2 lib/padrino-helpers/output_helpers/haml_handler.rb
padrino-helpers-0.12.0.rc1 lib/padrino-helpers/output_helpers/haml_handler.rb