Class: String
- Includes:
- Ruuuby::Attribute::Includable::Cardinality, Ruuuby::Attribute::Includable::SubscriptIndexing, Ruuuby::Attribute::Includable::SyntaxCache, Ruuuby::Feature::Includable::StringF08, Ruuuby::Feature::Includable::StringF09, Ruuuby::Feature::Includable::StringF21, Ruuuby::Feature::Includable::StringF26
- Defined in:
- lib/ruuuby/class/str/str.rb,
lib/ruuuby/class/str/context_case_syntax.rb
Overview
Ruuuby modifications to existing Class<code>String</code>
Defined Under Namespace
Modules: ContextF24, Syntax
Instance Method Summary collapse
-
#as_utf8 ⇒ String
Self with modified
encodingif not alreadyUTF-8. - #clean! ⇒ Object
-
#palindrome? ⇒ Boolean
True, if this
Stringhas equal contents written forwards or backwards. -
#η̂(normalizer) ⇒ String
TODO: not finalized design.
Methods included from Ruuuby::Feature::Includable::StringF26
#as_iso8601, #iso8601?, #to_iso8601
Methods included from Ruuuby::Feature::Includable::StringF21
Methods included from Ruuuby::Feature::Includable::StringF09
Methods included from Ruuuby::Feature::Includable::StringF08
#downcase?, #ensure_ending!, #ensure_start!, #remove_until, #remove_until_last, #upcase?, #♻️⟵
Methods included from Ruuuby::Attribute::Includable::Cardinality
included, #𝔠₁?, #𝔠₂?, #𝔠₃?, #𝔠₄?, #𝔠₅?, #𝔠₋
Methods included from Ruuuby::Attribute::Includable::SyntaxCache
Methods included from Ruuuby::Attribute::Includable::SubscriptIndexing
Instance Method Details
#as_utf8 ⇒ String
Returns self with modified encoding if not already UTF-8.
420 |
# File 'lib/ruuuby/class/str/str.rb', line 420 def as_utf8; self.force_encoding(::Encoding::UTF_8); end |
#clean! ⇒ Object
402 403 404 |
# File 'lib/ruuuby/class/str/str.rb', line 402 def clean! self.gsub!($/, '') end |
#palindrome? ⇒ Boolean
Returns true, if this String has equal contents written forwards or backwards.
423 |
# File 'lib/ruuuby/class/str/str.rb', line 423 def palindrome?; self == self.↩; end |
#η̂(normalizer) ⇒ String
TODO: not finalized design
411 412 413 414 415 416 417 |
# File 'lib/ruuuby/class/str/str.rb', line 411 def η̂(normalizer) if normalizer == :iso8601 self.as_iso8601 else 🛑 RuntimeError.new("c{String}-> m{η̂} got invalid arg(normalizer){#{normalizer.to_s}} w/ type{#{normalizer.Ⓣ}}") end end |