class String
Public Instance Methods
ascii?()
click to toggle source
# File lib/string.rb, line 2 def ascii? each_byte.all? { |c| c < 128 } end
include_any?(other_strs)
click to toggle source
# File lib/stones_spec/string.rb, line 7 def include_any?(other_strs) other_strs.any? { |other| include? other } end
non_ascii_context(size)
click to toggle source
# File lib/string.rb, line 6 def non_ascii_context(size) gsub(/(.{0,#{size}}[^\p{ASCII}]+.{0,#{size}})/).first.try { |it| "...#{it}..." } end
start_with_lowercase?()
click to toggle source
# File lib/stones_spec/string.rb, line 2 def start_with_lowercase? first_letter = self[0] first_letter.downcase == first_letter end