| Class | SM::Fragment |
| In: |
rdoc/markup/simple_markup/fragments.rb
|
| Parent: | Object |
A Fragment is a chunk of text, subclassed as a paragraph, a list entry, or verbatim text
| TYPE_MAP | = | {} | This is a simple factory system that lets us associate fragement types (a string) with a subclass of fragment |
| level | [R] | |
| param | [R] | |
| txt | [R] | |
| type | [RW] |
# File rdoc/markup/simple_markup/fragments.rb, line 41 def Fragment.for(line) klass = TYPE_MAP[line.type] || raise("Unknown line type: '#{line.type.inspect}:' '#{line.text}'") return klass.new(line.level, line.param, line.flag, line.text) end
# File rdoc/markup/simple_markup/fragments.rb, line 14 def initialize(level, param, type, txt) @level = level @param = param @type = type @txt = "" add_text(txt) if txt end
# File rdoc/markup/simple_markup/fragments.rb, line 37 def Fragment.type_name(name) TYPE_MAP[name] = self end
ruby-doc.org is hosted and run by James Britt and Happy Camper Studios, a Ruby application development company in Phoenix, Arizona. Ruby-doc.org was created in 2002 to promote the Ruby language and to help other Ruby hackers.
Documentation content on ruby-doc.org is provided by remarkable members of the Ruby community.
For more information on the Ruby programming language, visit ruby-lang.org.
Want to help improve Ruby's API docs? See Ruby Documentation Guidelines.