instance method
abbrev
Ruby on Rails 2.3.18
Since v2.3.18 Last seen in v3.0.20Available in: v2.3.18 v3.0.20
Signature
abbrev(s)
No documentation comment.
Parameters
-
sreq
Source
# File activesupport/lib/active_support/json/backends/okjson.rb, line 255
def abbrev(s)
t = s[0,10]
p = t['`']
t = t[0,p] if p
t = t + '...' if t.length < s.length
'`' + t + '`'
end
Defined in activesupport/lib/active_support/json/backends/okjson.rb line 255
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::OkJson