Module: Ruuuby::Feature::Includable::StringF09

Included in:
String
Defined in:
lib/ruuuby/class/str/str.rb

Overview

defines the operations needed to support Feature(f09) that are applied to Class(String)

Instance Method Summary collapse

Instance Method Details

#∈?(them) ⇒ Boolean

Returns true, if this string instance is contained in the provided str (or array/set).

Parameters:

Returns:

  • (Boolean)

    true, if this string instance is contained in the provided str (or array/set)

Raises:

  • (ArgumentError)


164
165
166
167
# File 'lib/ruuuby/class/str/str.rb', line 164

def ∈?(them)
  🛑 ArgumentError.new("| c{String}-> m{∈?} will only accept args of type{String, Array, Set}, not the provided type{#{them.}} from arg{#{them.to_s}} |") unless (them.str? || them.ary? || them.is_a?(Set))
  them.∋?(self)
end

#∉?(them) ⇒ Boolean

Returns true, if this string instance is not contained in the provided str (or array/set).

Parameters:

Returns:

  • (Boolean)

    true, if this string instance is not contained in the provided str (or array/set)

Raises:

  • (ArgumentError)


154
155
156
157
# File 'lib/ruuuby/class/str/str.rb', line 154

def ∉?(them)
  🛑 ArgumentError.new("| c{String}-> m{∉?} will only accept args of type{String, Array, Set}, not the provided type{#{them.}} from arg{#{them.to_s}} |") unless (them.str? || them.ary? || them.is_a?(Set))
  them.∌?(self)
end

#∋?(them) ⇒ Boolean

Returns true, if this string instance contains the provided str.

Parameters:

Returns:

  • (Boolean)

    true, if this string instance contains the provided str

Raises:

  • (ArgumentError)


140
# File 'lib/ruuuby/class/str/str.rb', line 140

def ∋?(them); 🛑str❓(:them, them); self.include?(them); end

#∌?(them) ⇒ Boolean

Returns true, if this string instance contains the provided str.

Parameters:

Returns:

  • (Boolean)

    true, if this string instance contains the provided str

Raises:

  • (ArgumentError)


147
# File 'lib/ruuuby/class/str/str.rb', line 147

def ∌?(them); 🛑str❓(:them, them); not self.include?(them); end