Class: String
- Inherits:
-
Object
show all
- Defined in:
- lib/railings/extensions/string.rb
Instance Method Summary
collapse
Instance Method Details
#parenthesize ⇒ Object
2
3
4
|
# File 'lib/railings/extensions/string.rb', line 2
def parenthesize
"(#{to_s})"
end
|
#questionable ⇒ Object
6
7
8
|
# File 'lib/railings/extensions/string.rb', line 6
def questionable
questionable? ? to_s : "#{to_s}?"
end
|
#questionable! ⇒ Object
10
11
12
|
# File 'lib/railings/extensions/string.rb', line 10
def questionable!
replace questionable
end
|
#questionable? ⇒ Boolean
14
15
16
|
# File 'lib/railings/extensions/string.rb', line 14
def questionable?
self[-1, 1] == '?'
end
|