Sha256: efcabf2f541b70e2693339636d060e146bcc0594d2c47cf5c13c8d64e2d779e5

Contents?: true

Size: 445 Bytes

Versions: 2

Compression:

Stored size: 445 Bytes

Contents

require "idobadge/version"

module Idobadge
  {success: 'sun-o', warning: 'umbrella', important: 'bomb'}.each do |m, i|
    define_method(m) do |text, icon: i|
      "<span class=\"label label-#{__method__}\">" \
        "#{icon && %|<i class="fa fa-#{icon}"></i> |}" \
        "<span class=\"label label-inverse\">#{text}</span>" \
      "</span>"
    end
    module_function m
  end

  alias :failure :important
  module_function :failure
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
idobadge-0.0.2 lib/idobadge.rb
idobadge-0.0.1 lib/idobadge.rb