Sha256: 9e1c325fad3e38d52d12bd2f7354d370004c40e0af5a7de6f6f88a3dc6cb711f

Contents?: true

Size: 555 Bytes

Versions: 1

Compression:

Stored size: 555 Bytes

Contents

class WikiSymbol < Chunk::Abstract
    def self.pattern() /<:(.*?)>/ end

    attr_accessor :symbol_code

    def initialize(match_data, revision)
      super(match_data, revision)
      @symbol_code = match_data[1]
    end
    
    def unmask(content)
      tag = case symbol_code
        when 'cbx'  then '<input type="checkbox" disabled />'
        when 'cbxc' then '<input type="checkbox" disabled checked />'
        else symbol_code
      end

      return self if content.gsub!( Regexp.new(mask(content)), tag )
    end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
Pimki-1.3.092 app/models/chunks/wiki_symbols.rb