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