Class: Object

Inherits:
BasicObject
Defined in:
lib/wordnik_ruby_helpers.rb

Instance Method Summary collapse

Instance Method Details

#in?(obj) ⇒ Boolean



193
194
195
# File 'lib/wordnik_ruby_helpers.rb', line 193

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

#numeric?Boolean



187
188
189
# File 'lib/wordnik_ruby_helpers.rb', line 187

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