Sha256: 47a1117f63e0b2fd89162a336b74733df8ba400c0e5c87438807fc3b40288bfc

Contents?: true

Size: 727 Bytes

Versions: 12

Compression:

Stored size: 727 Bytes

Contents

# -*- coding: utf-8 -*-

require 'turnip_formatter/step'

module TurnipFormatter
  class Step
    module DSL
      #
      # @param [TurnipFormatter::Step]  step
      #
      def extended(step)
        templates.each do |style, template|
          step.docs[style] = {
            klass: template[:klass],
            value: step.instance_eval(&template[:block])
          }
        end
      end

      def add_template(klass, &block)
        ::TurnipFormatter::Step.add_template(status, klass, &block)
      end

      def remove_template(klass)
        ::TurnipFormatter::Step.remove_template(status, klass)
      end

      def templates
        ::TurnipFormatter::Step.templates[status] || []
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
turnip_formatter-0.2.11 lib/turnip_formatter/step/dsl.rb
turnip_formatter-0.2.10 lib/turnip_formatter/step/dsl.rb
turnip_formatter-0.2.9 lib/turnip_formatter/step/dsl.rb
turnip_formatter-0.2.8 lib/turnip_formatter/step/dsl.rb
turnip_formatter-0.2.7 lib/turnip_formatter/step/dsl.rb
turnip_formatter-0.2.6 lib/turnip_formatter/step/dsl.rb
turnip_formatter-0.2.5 lib/turnip_formatter/step/dsl.rb
turnip_formatter-0.2.4 lib/turnip_formatter/step/dsl.rb
turnip_formatter-0.2.3 lib/turnip_formatter/step/dsl.rb
turnip_formatter-0.2.2 lib/turnip_formatter/step/dsl.rb
turnip_formatter-0.2.1 lib/turnip_formatter/step/dsl.rb
turnip_formatter-0.2.0 lib/turnip_formatter/step/dsl.rb