Class: Object

Inherits:
BasicObject
Defined in:
lib/wordnik_ruby_helpers.rb

Instance Method Summary (collapse)

Instance Method Details

- (Boolean) in?(obj)



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

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

- (Boolean) numeric?



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

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