Sha256: d86ea8c835d715ac7d10034988418f6063e607274b9dd287c3aa1f6b73ffe8a1

Contents?: true

Size: 497 Bytes

Versions: 13

Compression:

Stored size: 497 Bytes

Contents

# frozen_string_literal: true

module Stepmod
  module Utils
    module Converters
      class ClauseRef < Stepmod::Utils::Converters::Base
        def convert(node, _state = {})
          " {{#{normalized_ref(node['linkend'])}}} "
        end

        private

        def normalized_ref(ref)
          return unless ref || ref.empty?

          ref.to_s.split(":").last.squeeze(" ").strip
        end
      end
      ReverseAdoc::Converters.register :clause_ref, ClauseRef.new
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
stepmod-utils-0.6.6 lib/stepmod/utils/converters/clause_ref.rb
stepmod-utils-0.6.5 lib/stepmod/utils/converters/clause_ref.rb
stepmod-utils-0.6.3 lib/stepmod/utils/converters/clause_ref.rb
stepmod-utils-0.6.2 lib/stepmod/utils/converters/clause_ref.rb
stepmod-utils-0.6.1 lib/stepmod/utils/converters/clause_ref.rb
stepmod-utils-0.6.0 lib/stepmod/utils/converters/clause_ref.rb
stepmod-utils-0.5.0 lib/stepmod/utils/converters/clause_ref.rb
stepmod-utils-0.4.14 lib/stepmod/utils/converters/clause_ref.rb
stepmod-utils-0.4.13 lib/stepmod/utils/converters/clause_ref.rb
stepmod-utils-0.4.12 lib/stepmod/utils/converters/clause_ref.rb
stepmod-utils-0.4.11 lib/stepmod/utils/converters/clause_ref.rb
stepmod-utils-0.4.10 lib/stepmod/utils/converters/clause_ref.rb
stepmod-utils-0.4.9 lib/stepmod/utils/converters/clause_ref.rb