Module: Fetching::FetchingArray::ArrayMethods

Included in:
Fetching::FetchingArray
Defined in:
lib/fetching/fetching_array.rb

Instance Method Summary collapse

Instance Method Details

#empty?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/fetching/fetching_array.rb', line 22

def empty?
  @table.empty?
end

#lengthObject Also known as: size



26
27
28
# File 'lib/fetching/fetching_array.rb', line 26

def length
  @table.length
end

#reverseObject



31
32
33
# File 'lib/fetching/fetching_array.rb', line 31

def reverse
  Fetching.from @table.reverse
end

#shuffle(*args) ⇒ Object



35
36
37
# File 'lib/fetching/fetching_array.rb', line 35

def shuffle *args
  Fetching.from @table.shuffle(*args)
end

#sort(&block) ⇒ Object



39
40
41
# File 'lib/fetching/fetching_array.rb', line 39

def sort &block
  Fetching.from @table.sort(&block)
end

#sort_by(&block) ⇒ Object



43
44
45
# File 'lib/fetching/fetching_array.rb', line 43

def sort_by &block
  Fetching.from @table.sort_by(&block)
end

#values_at(*args) ⇒ Object



47
48
49
# File 'lib/fetching/fetching_array.rb', line 47

def values_at *args
  Fetching.from(args.map { |i| self[i] })
end