Sha256: 6eea1d7991e73cbcd02acd94e7f9477326c25c665e61927d7951f1f483ed080c

Contents?: true

Size: 970 Bytes

Versions: 85

Compression:

Stored size: 970 Bytes

Contents

##
# A section of text that is added to the output document as-is

class RDoc::Markup::Raw

  ##
  # The component parts of the list

  attr_reader :parts

  ##
  # Creates a new Raw containing +parts+

  def initialize *parts
    @parts = []
    @parts.concat parts
  end

  ##
  # Appends +text+

  def << text
    @parts << text
  end

  def == other # :nodoc:
    self.class == other.class and @parts == other.parts
  end

  ##
  # Calls #accept_raw+ on +visitor+

  def accept visitor
    visitor.accept_raw self
  end

  ##
  # Appends +other+'s parts

  def merge other
    @parts.concat other.parts
  end

  def pretty_print q # :nodoc:
    self.class.name =~ /.*::(\w{1,4})/i

    q.group 2, "[#{$1.downcase}: ", ']' do
      q.seplist @parts do |part|
        q.pp part
      end
    end
  end

  ##
  # Appends +texts+ onto this Paragraph

  def push *texts
    self.parts.concat texts
  end

  ##
  # The raw text

  def text
    @parts.join ' '
  end

end

Version data entries

85 entries across 55 versions & 6 rubygems

Version Path
rb2exe-0.3.1 bin/traveling-ruby-2.2.2/osx/lib/ruby/2.2.0/rdoc/markup/raw.rb
rb2exe-0.3.1 bin/traveling-ruby-2.2.2/win/lib/ruby/2.2.0/rdoc/markup/raw.rb
rb2exe-0.3.1 bin/traveling-ruby-2.2.2/l64/lib/ruby/2.2.0/rdoc/markup/raw.rb
rb2exe-0.3.1 bin/traveling-ruby-2.2.2/l32/lib/ruby/2.2.0/rdoc/markup/raw.rb
rb2exe-0.3.0 bin/traveling-ruby-2.2.2/l32/lib/ruby/2.2.0/rdoc/markup/raw.rb
rb2exe-0.3.0 bin/traveling-ruby-2.2.2/l64/lib/ruby/2.2.0/rdoc/markup/raw.rb
rb2exe-0.3.0 bin/traveling-ruby-2.2.2/win/lib/ruby/2.2.0/rdoc/markup/raw.rb
rb2exe-0.3.0 bin/traveling-ruby-2.2.2/osx/lib/ruby/2.2.0/rdoc/markup/raw.rb
rb2exe-0.2.5 bin/traveling-ruby-2.2.2/osx/lib/ruby/2.2.0/rdoc/markup/raw.rb
rb2exe-0.2.5 bin/traveling-ruby-2.2.2/l32/lib/ruby/2.2.0/rdoc/markup/raw.rb
rb2exe-0.2.5 bin/traveling-ruby-2.2.2/win/lib/ruby/2.2.0/rdoc/markup/raw.rb
rb2exe-0.2.5 bin/traveling-ruby-2.2.2/l64/lib/ruby/2.2.0/rdoc/markup/raw.rb
rb2exe-0.2.4 bin/traveling-ruby-2.2.2/osx/lib/ruby/2.2.0/rdoc/markup/raw.rb
rb2exe-0.2.4 bin/traveling-ruby-2.2.2/l32/lib/ruby/2.2.0/rdoc/markup/raw.rb
rb2exe-0.2.4 bin/traveling-ruby-2.2.2/l64/lib/ruby/2.2.0/rdoc/markup/raw.rb
rb2exe-0.2.4 bin/traveling-ruby-2.2.2/win/lib/ruby/2.2.0/rdoc/markup/raw.rb
rb2exe-0.2.3 bin/traveling-ruby-2.2.2/l64/lib/ruby/2.2.0/rdoc/markup/raw.rb
rb2exe-0.2.3 bin/traveling-ruby-2.2.2/osx/lib/ruby/2.2.0/rdoc/markup/raw.rb
rb2exe-0.2.3 bin/traveling-ruby-2.2.2/l32/lib/ruby/2.2.0/rdoc/markup/raw.rb
rb2exe-0.2.3 bin/traveling-ruby-2.2.2/win/lib/ruby/2.2.0/rdoc/markup/raw.rb