Sha256: d46f7997d7d96e5d23672027e2b1cb7b475bc08d28fda03d206fda8cd28cb122

Contents?: true

Size: 387 Bytes

Versions: 13

Compression:

Stored size: 387 Bytes

Contents

# -*- coding: utf-8 -*-

# Object extensions

class Object

  # Syntactic sugar for arrays.
  #
  # Definition:
  #   object.in? array === array.include? object
  #
  # @example
  #   array=['a','b','c']
  #   object='b'
  #   object.in? array 
  #   => true
  #
  # @return [Boolean] true iff this object is included in the array.
  def in?(array)
    array.include?(self)
  end
  
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
sixarm_ruby_ramp-5.0.2 lib/sixarm_ruby_ramp/object.rb
sixarm_ruby_ramp-5.0.1 lib/sixarm_ruby_ramp/object.rb
sixarm_ruby_ramp-5.0.0 lib/sixarm_ruby_ramp/object.rb
sixarm_ruby_ramp-4.2.7 lib/sixarm_ruby_ramp/object.rb
sixarm_ruby_ramp-4.2.5 lib/sixarm_ruby_ramp/object.rb
sixarm_ruby_ramp-4.2.4 lib/sixarm_ruby_ramp/object.rb
sixarm_ruby_ramp-4.2.3 lib/sixarm_ruby_ramp/object.rb
sixarm_ruby_ramp-4.2.2 lib/sixarm_ruby_ramp/object.rb
sixarm_ruby_ramp-4.1.0 lib/sixarm_ruby_ramp/object.rb
sixarm_ruby_ramp-4.0.0 lib/sixarm_ruby_ramp/object.rb
sixarm_ruby_ramp-3.0.0 lib/sixarm_ruby_ramp/object.rb
sixarm_ruby_ramp-2.1.3 lib/sixarm_ruby_ramp/object.rb
sixarm_ruby_ramp-2.1.0 lib/sixarm_ruby_ramp/object.rb