Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/core_extensions.rb
Overview
Rob Fors 20160105 core extensions I found useful
Instance Method Summary collapse
- #as {|_self| ... } ⇒ Object
- #false? ⇒ Boolean
- #in?(arg) ⇒ Boolean
- #is_not_a?(klass) ⇒ Boolean
- #not_nil? ⇒ Boolean
- #one_of?(*args) ⇒ Boolean
- #true? ⇒ Boolean
Instance Method Details
#false? ⇒ Boolean
18 19 20 |
# File 'lib/core_extensions.rb', line 18 def false? self == false end |
#in?(arg) ⇒ Boolean
26 27 28 |
# File 'lib/core_extensions.rb', line 26 def in?(arg) arg.include?(self) end |
#is_not_a?(klass) ⇒ Boolean
22 23 24 |
# File 'lib/core_extensions.rb', line 22 def is_not_a? klass !is_a?(klass) end |
#not_nil? ⇒ Boolean
6 7 8 |
# File 'lib/core_extensions.rb', line 6 def not_nil? !nil? end |
#one_of?(*args) ⇒ Boolean
30 31 32 |
# File 'lib/core_extensions.rb', line 30 def one_of?(*args) args.include?(self) end |
#true? ⇒ Boolean
14 15 16 |
# File 'lib/core_extensions.rb', line 14 def true? self == true end |