Module: JamfRubyExtensions::String::BackPorts

Included in:
String
Defined in:
lib/jamf/ruby_extensions/string/backports.rb

Instance Method Summary collapse

Instance Method Details

#casecmp?(other) ⇒ Boolean

Returns:

  • (Boolean)


54
55
56
57
58
# File 'lib/jamf/ruby_extensions/string/backports.rb', line 54

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

  casecmp(other).zero?
end

#delete_prefix(pfx) ⇒ Object



33
34
35
# File 'lib/jamf/ruby_extensions/string/backports.rb', line 33

def delete_prefix(pfx)
  sub /\A#{pfx}/, Jamf::BLANK
end

#delete_prefix!(pfx) ⇒ Object



37
38
39
# File 'lib/jamf/ruby_extensions/string/backports.rb', line 37

def delete_prefix!(pfx)
  sub! /\A#{pfx}/, Jamf::BLANK
end

#delete_suffix(sfx) ⇒ Object



41
42
43
# File 'lib/jamf/ruby_extensions/string/backports.rb', line 41

def delete_suffix(sfx)
  sub /#{sfx}\z/, Jamf::BLANK
end

#delete_suffix!(sfx) ⇒ Object



45
46
47
# File 'lib/jamf/ruby_extensions/string/backports.rb', line 45

def delete_suffix!(sfx)
  sub! /#{sfx}\z/, Jamf::BLANK
end