method

_expand_ch

Importance_0
v1_8_7_72 - Show latest stable - 0 notes - Class: String
_expand_ch(str) private

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/jcode.rb, line 99
  def _expand_ch str
    a = []
    str.scan(/(?:\\(.)|([^\\]))-(?:\\(.)|([^\\]))|(?:\\(.)|(.))/m) do
      from = $1 || $2
      to = $3 || $4
      one = $5 || $6
      if one
        a.push one
      elsif from.length != to.length
        next
      elsif from.length == 1
        from[0].upto(to[0]) { |c| a.push c.chr }
      else
        from.upto(to) { |c| a.push c }
      end
    end
    a
  end
Register or log in to add new notes.