Class: AsciidoctorDitaMap::Topic
- Inherits:
-
Object
- Object
- AsciidoctorDitaMap::Topic
- Defined in:
- lib/dita-map/topic.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#title ⇒ Object
Returns the value of attribute title.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(input, attributes = []) ⇒ Topic
constructor
A new instance of Topic.
Constructor Details
#initialize(input, attributes = []) ⇒ Topic
Returns a new instance of Topic.
30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/dita-map/topic.rb', line 30 def initialize input, attributes = [] if input.empty? @title = nil @type = nil else doc = Asciidoctor.load input, safe: :secure, attributes: attributes @title = doc.title ? doc.title.gsub(/<[^>]*>/, '') : nil @type = get_content_type doc.attributes end end |
Instance Attribute Details
#title ⇒ Object
Returns the value of attribute title.
28 29 30 |
# File 'lib/dita-map/topic.rb', line 28 def title @title end |
#type ⇒ Object
Returns the value of attribute type.
28 29 30 |
# File 'lib/dita-map/topic.rb', line 28 def type @type end |