Class: Confluence::Page::Details
- Inherits:
-
Hash
- Object
- Hash
- Confluence::Page::Details
- Defined in:
- lib/confluence/page.rb
Constant Summary collapse
- REGEXP =
/\{details:label=([^\}]+)\}([^\{}]*)\{details\}/m
- PAIR_REGEXP =
/([^:]+):([^\n]+)/m
Instance Attribute Summary collapse
-
#label ⇒ Object
readonly
Returns the value of attribute label.
Instance Method Summary collapse
-
#initialize(args) ⇒ Details
constructor
A new instance of Details.
- #to_s ⇒ Object
Constructor Details
#initialize(args) ⇒ Details
11 12 13 14 15 |
# File 'lib/confluence/page.rb', line 11 def initialize(args) @label = args[:label] parse(args[:content]) end |
Instance Attribute Details
#label ⇒ Object (readonly)
Returns the value of attribute label.
9 10 11 |
# File 'lib/confluence/page.rb', line 9 def label @label end |
Instance Method Details
#to_s ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/confluence/page.rb', line 17 def to_s # details macro content = "{details:label=#{label}}\n" each_pair do |key, value| content << "#{key}:#{value}\n" end # end of details macro content << "{details}\n" end |