Sha256: 23b5e5a61422be0d25d0fe98a79905aaa282c8143b4a0497d058bf961d52e7ce

Contents?: true

Size: 708 Bytes

Versions: 16

Compression:

Stored size: 708 Bytes

Contents

# frozen_string_literal: true

module DocTemplate
  module Tags
    class PositionTag < TableTag
      TAG_NAME = 'position'
      TEMPLATE = 'position.html.erb'

      def parse_table(table)
        table.remove && return unless @opts[:parent_tags].try(:include?, Tags::MaterialsTag::TAG_NAME)

        params = {
          content: table.at_xpath('.//tr[2]/td').inner_html,
          position: @opts[:value].strip
        }

        content = parse_template params, TEMPLATE
        @content = parse_nested(content, @opts)
        replace_tag table
      end
    end
  end

  # TODO: Currently will work only inside materials tag
  Template.register_tag(Tags::PositionTag::TAG_NAME, Tags::PositionTag)
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
lcms-engine-0.5.5 lib/doc_template/tags/position_tag.rb
lcms-engine-0.5.4 lib/doc_template/tags/position_tag.rb
lcms-engine-0.5.3 lib/doc_template/tags/position_tag.rb
lcms-engine-0.5.2 lib/doc_template/tags/position_tag.rb
lcms-engine-0.5.1 lib/doc_template/tags/position_tag.rb
lcms-engine-0.5.0 lib/doc_template/tags/position_tag.rb
lcms-engine-0.4.2 lib/doc_template/tags/position_tag.rb
lcms-engine-0.4.1 lib/doc_template/tags/position_tag.rb
lcms-engine-0.4.0 lib/doc_template/tags/position_tag.rb
lcms-engine-0.3.1 lib/doc_template/tags/position_tag.rb
lcms-engine-0.1.4 lib/doc_template/tags/position_tag.rb
lcms-engine-0.3.0 lib/doc_template/tags/position_tag.rb
lcms-engine-0.1.3 lib/doc_template/tags/position_tag.rb
lcms-engine-0.2.0 lib/doc_template/tags/position_tag.rb
lcms-engine-0.1.2 lib/doc_template/tags/position_tag.rb
lcms-engine-0.1.0 lib/doc_template/tags/position_tag.rb