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?

Instance Method Summary collapse

Instance Method Details

#each_charObject

:nodoc:



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

def each_char #:nodoc:
  # 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