Class: Array
- Inherits:
-
Object
- Object
- Array
- Defined in:
- lib/lxa_core_extensions/array.rb
Instance Method Summary collapse
Instance Method Details
#only ⇒ Object
2 3 4 5 |
# File 'lib/lxa_core_extensions/array.rb', line 2 def only raise "called Array#only with array of length #{length}" if length != 1 first end |
#random_element ⇒ Object
7 8 9 |
# File 'lib/lxa_core_extensions/array.rb', line 7 def random_element sample end |