Sha256: 465254301ea141bccc6a02e4e5bd45aa80af81944eb1a9fd90ab8828cfbf207f

Contents?: true

Size: 533 Bytes

Versions: 6

Compression:

Stored size: 533 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

6 entries across 6 versions & 1 rubygems

Version Path
Pimki-1.4.092 app/models/chunks/wiki_symbols.rb
Pimki-1.5.092 app/models/chunks/wiki_symbols.rb
Pimki-1.6.092 app/models/chunks/wiki_symbols.rb
Pimki-1.7.092 app/models/chunks/wiki_symbols.rb
Pimki-1.8.092 app/models/chunks/wiki_symbols.rb
Pimki-1.8.200 app/models/chunks/wiki_symbols.rb