Class SM::Attribute
In: markup/simple_markup/inline.rb
Parent: Object

We manage a set of attributes. Each attribute has a symbol name and a bit value

Methods

Constants

SPECIAL = 1

Public Class methods

[Source]

    # File markup/simple_markup/inline.rb, line 22
22:     def Attribute.as_string(bitmap)
23:       return "none" if bitmap.zero?
24:       res = []
25:       @@name_to_bitmap.each do |name, bit|
26:         res << name if (bitmap & bit) != 0
27:       end
28:       res.join(",")
29:     end

[Source]

    # File markup/simple_markup/inline.rb, line 12
12:     def Attribute.bitmap_for(name)
13:       bitmap = @@name_to_bitmap[name]
14:       if !bitmap
15:         bitmap = @@next_bitmap
16:         @@next_bitmap <<= 1
17:         @@name_to_bitmap[name] = bitmap
18:       end
19:       bitmap
20:     end

[Source]

    # File markup/simple_markup/inline.rb, line 31
31:     def Attribute.each_name_of(bitmap)
32:       @@name_to_bitmap.each do |name, bit|
33:         next if bit == SPECIAL
34:         yield name.to_s if (bitmap & bit) != 0
35:       end
36:     end

[Validate]