Class: Coradoc::Element::Term
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
-
#term ⇒ Object
Returns the value of attribute term.
Instance Method Summary collapse
-
#initialize(term, options = {}) ⇒ Term
constructor
A new instance of Term.
- #to_adoc ⇒ Object
Methods inherited from Base
#children_accessors, children_accessors, declare_children, #simplify_block_content, visit, #visit
Constructor Details
#initialize(term, options = {}) ⇒ Term
Returns a new instance of Term.
8 9 10 11 12 13 |
# File 'lib/coradoc/element/term.rb', line 8 def initialize(term, = {}) @term = term @type = .fetch(:type, nil) @lang = .fetch(:lang, :en) @line_break = .fetch(:line_break, "") end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
4 5 6 |
# File 'lib/coradoc/element/term.rb', line 4 def @options end |
#term ⇒ Object
Returns the value of attribute term.
4 5 6 |
# File 'lib/coradoc/element/term.rb', line 4 def term @term end |
Instance Method Details
#to_adoc ⇒ Object
15 16 17 18 |
# File 'lib/coradoc/element/term.rb', line 15 def to_adoc return "#{@type}:[#{@term}]#{@line_break}" if @lang == :en "[#{@type}]##{@term}##{@line_break}" end |