Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/wordnik_ruby_helpers.rb
Instance Method Summary (collapse)
-
- (Boolean) in?(obj)
zeke.tumblr.com/post/6167737445/ruby-syntactic-sugar-object-in 4.in? [1, 2, 3, 4, 5].
- - (Boolean) numeric?
Instance Method Details
- (Boolean) in?(obj)
zeke.tumblr.com/post/6167737445/ruby-syntactic-sugar-object-in 4.in? [1, 2, 3, 4, 5]
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 |