Module: Inform::SetHelpers

Included in:
Enumerable, Object
Defined in:
lib/runtime/helpers.rb

Overview

Some mixins provide exclusive Inform-ification for Ruby, withheld from mixins.rb because of said exclusivity

Instance Method Summary collapse

Instance Method Details

#in?(*others) ⇒ Boolean

Returns:

  • (Boolean)


28
29
30
31
# File 'lib/runtime/helpers.rb', line 28

def in?(*others)
  return false unless others.respond_to?(:include?)
  others.flatten.include?(self)
end

#notin?(*others) ⇒ Boolean

Returns:

  • (Boolean)


33
34
35
36
# File 'lib/runtime/helpers.rb', line 33

def notin?(*others)
  return false unless others.respond_to?(:include?)
  !others.flatten.include?(self)
end