Sha256: 2b343f676da1d0aa9d4fb73e8c25df839a55ba91800da79e8b6c7d115ae92fd2

Contents?: true

Size: 927 Bytes

Versions: 30

Compression:

Stored size: 927 Bytes

Contents

require 'rd/element'
require 'rd/list'
require 'rd/complex-list-item'
require 'rd/labeled-element'

module RD
  class DescList < List
    def accept(visitor)
      visitor.visit_DescList(self)
    end
  end
  
  class DescListItem < ListItem
    include ComplexListItem
    
    attr_reader :term
    attr_reader :description
    
    def initialize
      @term = nil
      @description = []
      @label = nil
    end

    def accept(visitor)
      visitor.visit_DescListItem(self)
    end

    class Term < Element
      include NonterminalElement
      include LabeledElement
      
      def initialize
	@content = []
      end

      def calculate_label
	ret = ""
	children.each do |i|
	  ret.concat(i.to_label)
	end
	ret
      end
      private :calculate_label

      def accept(visitor)
	visitor.visit_DescListItemTerm(self)
      end
      
      def children
	@content
      end
    end
  end # DescListItem
end # RD

Version data entries

30 entries across 29 versions & 4 rubygems

Version Path
rdtool-0.6.31 lib/rd/desclist.rb
rdtool-0.6.30 lib/rd/desclist.rb
rdtool-0.6.29 lib/rd/desclist.rb
rdtool-0.6.28 lib/rd/desclist.rb
rdtool-0.6.27 lib/rd/desclist.rb
rdtool-0.6.26 lib/rd/desclist.rb
rdtool-0.6.25 lib/rd/desclist.rb
rdtool-0.6.23 lib/rd/desclist.rb
rd2odt-0.1.1 lib/rd2odt/rdtool/rd/desclist.rb
rd2odt-0.1.0 lib/rd2odt/rdtool/rd/desclist.rb