Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/prawn/compatibility.rb

Overview

Why would we ever use Ruby 1.8.7 when we can backport with something as simple as this?

Direct Known Subclasses

Prawn::ByteString, Prawn::LiteralString

Instance Method Summary collapse

Instance Method Details

#each_charObject



14
15
16
17
18
19
20
21
# File 'lib/prawn/compatibility.rb', line 14

def each_char
  # copied from jcode
  if block_given?
    scan(/./m) { |x| yield x }
  else
    scan(/./m)
  end
end

#first_lineObject

:nodoc:



7
8
9
# File 'lib/prawn/compatibility.rb', line 7

def first_line
  self.each_line { |line| return line }
end