Module: UselessString::WithOnlyStarter
- Included in:
- String
- Defined in:
- lib/with_only_starter.rb
Instance Method Summary collapse
Instance Method Details
#cmp_with_only(other_str, options = {}) ⇒ Object
9 10 11 12 |
# File 'lib/with_only_starter.rb', line 9 def cmp_with_only(other_str, = {}) remove_extras(str = self.dup, other = other_str.dup, create_regex()) [:case_insensitive] ? str.casecmp(other) : str <=> other end |
#eql_with_only?(other_str, options = {}) ⇒ Boolean
4 5 6 7 |
# File 'lib/with_only_starter.rb', line 4 def eql_with_only?(other_str, = {}) remove_extras(str = self.dup, other = other_str.dup, r = create_regex()) [:case_insensitive] ? str.upcase.eql?(other.upcase) : str.eql?(other) end |