Class: Array
- Defined in:
- lib/freighthopper/array/exclude.rb,
lib/freighthopper/array/symbols.rb,
lib/freighthopper/array/singular.rb
Instance Method Summary collapse
- #exclude?(item) ⇒ Boolean
- #singular ⇒ Object
- #singular! ⇒ Object
- #singular? ⇒ Boolean
- #symbols ⇒ Object
Instance Method Details
#exclude?(item) ⇒ Boolean
2 |
# File 'lib/freighthopper/array/exclude.rb', line 2 def exclude?(item) ! include? item end |
#singular ⇒ Object
3 |
# File 'lib/freighthopper/array/singular.rb', line 3 def singular() singular?? first : nil end |
#singular! ⇒ Object
4 |
# File 'lib/freighthopper/array/singular.rb', line 4 def singular!() singular or raise "not singular" end |
#singular? ⇒ Boolean
2 |
# File 'lib/freighthopper/array/singular.rb', line 2 def singular?() size == 1 end |
#symbols ⇒ Object
2 |
# File 'lib/freighthopper/array/symbols.rb', line 2 def symbols() map {|x| x.to_sym} end |