instance method
nibble
Ruby on Rails 2.3.18
Since v2.3.18 Last seen in v3.0.20Available in: v2.3.18 v3.0.20
Signature
nibble(c)
No documentation comment.
Parameters
-
creq
Source
# File activesupport/lib/active_support/json/backends/okjson.rb, line 387
def nibble(c)
case true
when ?0 <= c && c <= ?9 then c.ord - ?0.ord
when ?a <= c && c <= ?z then c.ord - ?a.ord + 10
when ?A <= c && c <= ?Z then c.ord - ?A.ord + 10
else
raise Error, "invalid hex code #{c}"
end
end
Defined in activesupport/lib/active_support/json/backends/okjson.rb line 387
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::OkJson