Method: Symbol#default!
- Defined in:
- lib/y_support/core_ext/symbol/misc.rb
#default!(default_symbol) ⇒ Object
This method applies String#default! method to the receiver converted to a string. Of course, symbols are immutable, so in spite of the exclamation mark in the method name, a new symbol (supplied as argument) is returned, if the original one is considered “defaulted” (otherwise, original symbol is returned unchanged).
10 11 12 |
# File 'lib/y_support/core_ext/symbol/misc.rb', line 10 def default! default_symbol to_s.default!( default_symbol ).to_sym end |