Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/write_xlsx/compatibility.rb
Overview
Why would we ever use Ruby 1.8.7 when we can backport with something as simple as this?
copied from prawn. modified by Hideo NAKAMURA
Instance Method Summary collapse
- #ascii_only? ⇒ Boolean
-
#bytesize ⇒ Object
:nodoc:.
-
#each_char(&block) ⇒ Object
:nodoc:.
-
#first_line ⇒ Object
:nodoc:.
- #ord ⇒ Object
Instance Method Details
#ascii_only? ⇒ Boolean
40 41 42 |
# File 'lib/write_xlsx/compatibility.rb', line 40 def ascii_only? !!(self =~ %r{[^!"#$%&'()*+,\-./:;<=>?@0-9A-Za-z_\[\\\]\{\}^` ~\0\n]}) end |
#bytesize ⇒ Object
:nodoc:
28 29 30 |
# File 'lib/write_xlsx/compatibility.rb', line 28 def bytesize # :nodoc: length end |
#each_char(&block) ⇒ Object
:nodoc:
17 18 19 20 21 22 23 24 |
# File 'lib/write_xlsx/compatibility.rb', line 17 def each_char(&block) # :nodoc: # copied from jcode if block_given? scan(/./m, &block) else scan(/./m) end end |
#first_line ⇒ Object
:nodoc:
12 13 14 |
# File 'lib/write_xlsx/compatibility.rb', line 12 def first_line each_line { |line| return line } end |
#ord ⇒ Object
34 35 36 |
# File 'lib/write_xlsx/compatibility.rb', line 34 def ord self[0] end |