Class: String

Inherits:
Object show all
Includes:
JSSRubyExtensions::String::BackPorts, JSSRubyExtensions::String::Conversions, JSSRubyExtensions::String::Predicates, JamfRubyExtensions::String::BackPorts, JamfRubyExtensions::String::Conversions, JamfRubyExtensions::String::Predicates
Defined in:
lib/jss/ruby_extensions/string.rb,
lib/jss/compatibility.rb,
lib/jss/compatibility.rb,
lib/jamf/compatibility.rb,
lib/jamf/compatibility.rb,
lib/jamf/ruby_extensions/string.rb

Overview

include the modules loaded above

Instance Method Summary collapse

Instance Method Details

#casecmp?(other) ⇒ Boolean

Returns:

  • (Boolean)


81
82
83
84
85
# File 'lib/jss/compatibility.rb', line 81

def casecmp?(other)
  return nil unless other.is_a? String

  casecmp(other).zero?
end

#delete_prefix(pfx) ⇒ Object Originally defined in module JamfRubyExtensions::String::BackPorts

#delete_prefix!(pfx) ⇒ Object Originally defined in module JamfRubyExtensions::String::BackPorts

#delete_suffix(sfx) ⇒ Object Originally defined in module JamfRubyExtensions::String::BackPorts

#delete_suffix!(sfx) ⇒ Object Originally defined in module JamfRubyExtensions::String::BackPorts

#force_encoding(_args = nil) ⇒ Object



66
67
68
# File 'lib/jss/compatibility.rb', line 66

def force_encoding(_args = nil)
  self
end

#j_float?Boolean Originally defined in module JamfRubyExtensions::String::Predicates

Is this string also a floar? (i.e. it consists only of numberic digits)

Returns:

  • (Boolean)

#j_integer?Boolean Originally defined in module JamfRubyExtensions::String::Predicates

Is this string also an integer? (i.e. it consists only of numberic digits, maybe with a dash in front)

Returns:

  • (Boolean)

#j_to_boolBoolean? Originally defined in module JamfRubyExtensions::String::Conversions

Convert the strings “true” and “false” (after stripping whitespace and downcasing) to TrueClass and FalseClass respectively

Return nil if any other string.

Returns:

  • (Boolean, nil)

    the boolean value

#j_to_pathnamePathname Originally defined in module JamfRubyExtensions::String::Conversions

Convert a String to a Pathname object

Returns:

#j_to_timestampTime Originally defined in module JamfRubyExtensions::String::Conversions

Convert a string to a Jamf::Timestamp object

Returns:

  • (Time)

    the time represented by the string.

#jss_float?Boolean Originally defined in module JSSRubyExtensions::String::Predicates

Is this string also a floar? (i.e. it consists only of numberic digits)

Returns:

  • (Boolean)

#jss_integer?Boolean Originally defined in module JSSRubyExtensions::String::Predicates

Is this string also an integer? (i.e. it consists only of numberic digits, maybe with a dash in front)

Returns:

  • (Boolean)

#jss_to_boolBoolean? Originally defined in module JSSRubyExtensions::String::Conversions

Convert the strings “true” and “false” (after stripping whitespace and downcasing) to TrueClass and FalseClass respectively

Return nil if any other string.

Returns:

  • (Boolean, nil)

    the boolean value

#jss_to_pathnamePathname Originally defined in module JSSRubyExtensions::String::Conversions

Convert a String to a Pathname object

Returns:

#jss_to_timeTime Originally defined in module JSSRubyExtensions::String::Conversions

Convert a string to a Time object

returns nil if not parsable by JSS::parse_datetime

Returns:

  • (Time)

    the time represented by the string.