Sha256: 0bb6b8a236173c6b7ecfe87f886b5f03cf9de93df60e086abdb19f17b76dfd60

Contents?: true

Size: 269 Bytes

Versions: 16

Compression:

Stored size: 269 Bytes

Contents

class String

  # add ends_with? support if method is missing
  def method_missing(m, *args, &block)
    if m == :ends_with?
      suffix = args[0]
      suffix.respond_to?(:to_str) && self[-suffix.length, suffix.length] == suffix
    else
      super
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
cobweb-1.0.28 lib/string.rb
cobweb-1.0.27 lib/string.rb
cobweb-1.0.26 lib/string.rb
cobweb-1.0.25 lib/string.rb
cobweb-1.0.24 lib/string.rb
cobweb-1.0.23 lib/string.rb
cobweb-1.0.22 lib/string.rb
cobweb-1.0.21 lib/string.rb
cobweb-1.0.20 lib/string.rb
cobweb-1.0.19 lib/string.rb
cobweb-1.0.18 lib/string.rb
cobweb-1.0.17 lib/string.rb
cobweb-1.0.16 lib/string.rb
cobweb-1.0.15 lib/string.rb
cobweb-1.0.12 lib/string.rb
cobweb-1.0.11 lib/string.rb