Sha256: 2d07877e91ad77014cdfd267ceecc57fe938e7a1f1d1628a9f5f8d950387b21c

Contents?: true

Size: 758 Bytes

Versions: 21

Compression:

Stored size: 758 Bytes

Contents

module Nexmo
  module OAS
    module Renderer
      module Filters
        class Icon < Banzai::Filter
          def call(input)
            input.gsub!('✅', '<svg class="Vlt-green Vlt-icon Vlt-icon--small"><use xlink:href="/assets/symbol/volta-icons.svg#Vlt-icon-check" /></svg>')
            input.gsub!('❌', '<svg class="Vlt-red Vlt-icon Vlt-icon--small"><use xlink:href="/assets/symbol/volta-icons.svg#Vlt-icon-cross" /></svg>')

            input.gsub!(/\[icon="(.+?)"\]/) do
              <<~HEREDOC
                <svg class="Vlt-green Vlt-icon Vlt-icon--small"><use xlink:href="/assets/symbol/volta-icons.svg#Vlt-icon-#{$1}" /></svg>
              HEREDOC
            end

            input
          end
        end
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
nexmo-oas-renderer-0.7.1 lib/nexmo/oas/renderer/filters/icon.rb
nexmo-oas-renderer-0.7.0 lib/nexmo/oas/renderer/filters/icon.rb
nexmo-oas-renderer-0.6.6 lib/nexmo/oas/renderer/filters/icon.rb
nexmo-oas-renderer-0.6.5 lib/nexmo/oas/renderer/filters/icon.rb
nexmo-oas-renderer-0.6.4 lib/nexmo/oas/renderer/filters/icon.rb
nexmo-oas-renderer-0.6.3 lib/nexmo/oas/renderer/filters/icon.rb
nexmo-oas-renderer-0.6.2 lib/nexmo/oas/renderer/filters/icon.rb
nexmo-oas-renderer-0.6.1 lib/nexmo/oas/renderer/filters/icon.rb
nexmo-oas-renderer-0.5.6 lib/nexmo/oas/renderer/filters/icon.rb
nexmo-oas-renderer-0.5.5 lib/nexmo/oas/renderer/filters/icon.rb
nexmo-oas-renderer-0.5.4 lib/nexmo/oas/renderer/filters/icon.rb
nexmo-oas-renderer-0.5.2 lib/nexmo/oas/renderer/filters/icon.rb
nexmo-oas-renderer-0.5.1 lib/nexmo/oas/renderer/filters/icon.rb
nexmo-oas-renderer-0.5.0 lib/nexmo/oas/renderer/filters/icon.rb
nexmo-oas-renderer-0.4.1 lib/nexmo/oas/renderer/filters/icon.rb
nexmo-oas-renderer-0.4.0 lib/nexmo/oas/renderer/filters/icon.rb
nexmo-oas-renderer-0.2.1 lib/nexmo/oas/renderer/filters/icon.rb
nexmo-oas-renderer-0.2.0 lib/nexmo/oas/renderer/filters/icon.rb
nexmo-oas-renderer-0.1.2 lib/nexmo/oas/renderer/filters/icon.rb
nexmo-oas-renderer-0.1.1 lib/nexmo/oas/renderer/filters/icon.rb