Class: Array
- Inherits:
-
Object
show all
- Defined in:
- lib/ethereum/core_ext/object/truth.rb,
lib/ethereum/core_ext/array/safe_slice.rb
Instance Method Summary
collapse
Instance Method Details
#false? ⇒ Boolean
14
15
16
|
# File 'lib/ethereum/core_ext/object/truth.rb', line 14
def false?
empty?
end
|
#safe_slice(*args) ⇒ Object
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
# File 'lib/ethereum/core_ext/array/safe_slice.rb', line 4
def safe_slice(*args)
if args.size == 2
return [] if args[1] == 0
slice(args[0], args[1]) || []
elsif args.size == 1
if args[0].instance_of?(Range)
slice(args[0]) || []
else
slice(args[0])
end
else
slice(*args)
end
end
|