Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/codebutler/sinatra.rb,
lib/codebutler/sinatra.rb
Instance Method Summary collapse
-
#from_param ⇒ Object
Converts
selffrom an escaped URI parameter value ‘Foo%20Bar’.from_param # => ‘Foo Bar’. -
#to_param ⇒ Object
Converts
selfto an escaped URI parameter value ‘Foo Bar’.to_param # => ‘Foo%20Bar’. - #to_result(cx, *args) ⇒ Object
Instance Method Details
#from_param ⇒ Object
Converts self from an escaped URI parameter value
'Foo%20Bar'.from_param # => 'Foo Bar'
961 962 963 |
# File 'lib/codebutler/sinatra.rb', line 961 def from_param URI.unescape(self) end |
#to_param ⇒ Object
Converts self to an escaped URI parameter value
'Foo Bar'.to_param # => 'Foo%20Bar'
955 956 957 |
# File 'lib/codebutler/sinatra.rb', line 955 def to_param URI.escape(self) end |
#to_result(cx, *args) ⇒ Object
1021 1022 1023 1024 |
# File 'lib/codebutler/sinatra.rb', line 1021 def to_result(cx, *args) args.shift.to_result(cx, *args) self end |