Sha256: d3336d351eaee535cc70e60a40a9e31c54ea12ece45706fc11641946183b4984

Contents?: true

Size: 512 Bytes

Versions: 57

Compression:

Stored size: 512 Bytes

Contents

class Object
  # Returns true if this object is included in the argument. Argument must be
  # any object which responds to +#include?+. Usage:
  #
  #   characters = ["Konata", "Kagami", "Tsukasa"]
  #   "Konata".in?(characters) # => true
  #
  # This will throw an ArgumentError if the argument doesn't respond
  # to +#include?+.
  def in?(another_object)
    another_object.include?(self)
  rescue NoMethodError
    raise ArgumentError.new("The parameter passed to #in? must respond to #include?")
  end
end

Version data entries

57 entries across 57 versions & 2 rubygems

Version Path
activesupport-3.1.6 lib/active_support/core_ext/object/inclusion.rb
dirty_history-0.5.4 dirty_history/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/core_ext/object/inclusion.rb
activesupport-3.1.5 lib/active_support/core_ext/object/inclusion.rb
activesupport-3.1.5.rc1 lib/active_support/core_ext/object/inclusion.rb
dirty_history-0.5.3 dirty_history/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/core_ext/object/inclusion.rb
dirty_history-0.5.2 dirty_history/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/core_ext/object/inclusion.rb
activesupport-3.1.4 lib/active_support/core_ext/object/inclusion.rb
activesupport-3.1.4.rc1 lib/active_support/core_ext/object/inclusion.rb
dirty_history-0.5.1 dirty_history/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/core_ext/object/inclusion.rb
dirty_history-0.5.0 dirty_history/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/core_ext/object/inclusion.rb
dirty_history-0.4.10 dirty_history/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/core_ext/object/inclusion.rb
dirty_history-0.4.9 dirty_history/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/core_ext/object/inclusion.rb
dirty_history-0.4.8 dirty_history/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/core_ext/object/inclusion.rb
dirty_history-0.4.7 dirty_history/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/core_ext/object/inclusion.rb
dirty_history-0.4.6 dirty_history/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/core_ext/object/inclusion.rb
dirty_history-0.4.5 dirty_history/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/core_ext/object/inclusion.rb
dirty_history-0.4.4 dirty_history/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/core_ext/object/inclusion.rb
dirty_history-0.4.3 dirty_history/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/core_ext/object/inclusion.rb
dirty_history-0.4.2 dirty_history/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/core_ext/object/inclusion.rb
activesupport-3.1.3 lib/active_support/core_ext/object/inclusion.rb