Class: Object

Inherits:
BasicObject
Defined in:
lib/wordnik_ruby_helpers.rb

Instance Method Summary collapse

Instance Method Details

#in?(obj) ⇒ Boolean

Returns:

  • (Boolean)


165
166
167
# File 'lib/wordnik_ruby_helpers.rb', line 165

def in?(obj)
  obj.respond_to?(:include?) ? obj.include?(self) : false
end

#numeric?Boolean

Returns:

  • (Boolean)


159
160
161
# File 'lib/wordnik_ruby_helpers.rb', line 159

def numeric?
  !self.to_s.match(/\A[+-]?\d+?(\.\d+)?\Z/).nil?
end