Method: Daru::Index#slice
- Defined in:
- lib/daru/index/index.rb
#slice(*args) ⇒ Object
164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 |
# File 'lib/daru/index/index.rb', line 164 def slice *args start = args[0] en = args[1] start_idx = @relation_hash[start] en_idx = @relation_hash[en] if start_idx.nil? nil elsif en_idx.nil? Array(start_idx..size-1) else Array(start_idx..en_idx) end end |