Class: RTFM::DescriptionSection
- Inherits:
-
Struct
- Object
- Struct
- RTFM::DescriptionSection
- Defined in:
- lib/rtfm/sections/description.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
- #add_option(*args) ⇒ Object (also: #option)
-
#initialize(*args) {|_self| ... } ⇒ DescriptionSection
constructor
A new instance of DescriptionSection.
- #to_groff ⇒ Object
Constructor Details
#initialize(*args) {|_self| ... } ⇒ DescriptionSection
Returns a new instance of DescriptionSection.
3 4 5 6 7 |
# File 'lib/rtfm/sections/description.rb', line 3 def initialize(*args) super self. ||= [] yield self if block_given? end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body
2 3 4 |
# File 'lib/rtfm/sections/description.rb', line 2 def body @body end |
#options ⇒ Object
Returns the value of attribute options
2 3 4 |
# File 'lib/rtfm/sections/description.rb', line 2 def @options end |
Instance Method Details
#add_option(*args) ⇒ Object Also known as: option
9 10 11 12 13 14 |
# File 'lib/rtfm/sections/description.rb', line 9 def add_option(*args) if args.size == 1 && args.first.is_a?(Option) then self. << args.first else self. << Option.new(*args) end end |
#to_groff ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/rtfm/sections/description.rb', line 17 def to_groff GroffString.groffify do |out| out.section "description" out << self.body if .any? out.Bl "-tag", "-width", "\"mmmmmmmmmm\"", "-compact" .each do |option| out << option.to_groff(:item) end out.El out.Pp end end end |