Sha256: cd21e859f28c93d2288f8acf5810806390f208b7640545aaf00845b99ca6038e

Contents?: true

Size: 519 Bytes

Versions: 2

Compression:

Stored size: 519 Bytes

Contents

#
# short inspect method on all objects.
#
# "abcdefghijklmnopabcdefghijklmnopabcdefghijklmnopabcdefghijklmnop".insp
#    -> "abcdefghijklmnopabcdefghijk..."
# Model.find(1).insp 
#    -> "<Model#1>"

module Object::InMethod
  def in?(collection)
    collection.include?(self)
  end
end

class Object
  include InMethod
end

module Object::InMethod::Etest
  def test_in
    assert_equal true, "1".in?(%w(1 2 3))
    assert_equal false, 1.in?(%w(1 2 3))
    assert_equal false, 1.in?([])
  end
end if VEX_TEST == "base"

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
vex-0.6.2 lib/vex/base/object/in.rb
vex-0.4.4 lib/vex/base/object/in.rb