Module: Ruuuby::Feature::Includable::StringF08
- Included in:
- String
- Defined in:
- lib/ruuuby/class/str/str.rb
Overview
defines the operations needed to support Feature(f08) that are applied to Class(String)
Instance Method Summary collapse
-
#downcase? ⇒ Boolean
True, if this
Stringis of length 1 and the character is lowercase. -
#ensure_ending!(ending) ⇒ String
The original string with ending-string added if missing prior.
-
#ensure_start!(start) ⇒ String
The original string with the starting text added if at least partially missing prior.
-
#remove_until(stop_at, num_matches = 1) ⇒ String
Self, with all content (leading up to argterminating_pattern) removed.
-
#remove_until_last(stop_at) ⇒ String
Self, with all content (leading up to argterminating_pattern) removed.
-
#upcase? ⇒ Boolean
True, if this
Stringis of length 1 and the character is uppercase. -
#♻️⟵(stop_at, num_matches = 1) ⇒ String
Self, with all content (leading up to argstop_at) removed, searched from reversed order and then returned back in original order.
Instance Method Details
#downcase? ⇒ Boolean
Returns true, if this String is of length 1 and the character is lowercase.
30 31 32 33 34 35 36 37 38 39 |
# File 'lib/ruuuby/class/str/str.rb', line 30 def downcase? case(self. |
#ensure_ending!(ending) ⇒ String
Returns the original string with ending-string added if missing prior.
117 118 119 120 121 122 123 124 125 126 127 128 129 |
# File 'lib/ruuuby/class/str/str.rb', line 117 def ensure_ending!(ending) |
#ensure_start!(start) ⇒ String
Returns the original string with the starting text added if at least partially missing prior.
98 99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/ruuuby/class/str/str.rb', line 98 def ensure_start!(start) |
#remove_until(stop_at, num_matches = 1) ⇒ String
Returns self, with all content (leading up to argterminating_pattern) removed.
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/ruuuby/class/str/str.rb', line 47 def remove_until(stop_at, num_matches=1) |
#remove_until_last(stop_at) ⇒ String
Returns self, with all content (leading up to argterminating_pattern) removed.
91 |
# File 'lib/ruuuby/class/str/str.rb', line 91 def remove_until_last(stop_at) ; self.remove_until(stop_at, -1) ; end |
#upcase? ⇒ Boolean
Returns true, if this String is of length 1 and the character is uppercase.
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/ruuuby/class/str/str.rb', line 18 def upcase? case(self. |
#♻️⟵(stop_at, num_matches = 1) ⇒ String
Returns self, with all content (leading up to argstop_at) removed, searched from reversed order and then returned back in original order.
81 82 83 84 |
# File 'lib/ruuuby/class/str/str.rb', line 81 def |