Class: Array

Inherits:
Object
  • Object
show all
Defined in:
lib/quandl/operation/core_ext/array.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.forwardable_methodsObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/quandl/operation/core_ext/array.rb', line 2

def self.forwardable_methods
  [:reject, :keep_if, :to_a, :cycle, :drop, :map, :rotate, :each_slice, :pack, :select!,
   :combination, :repeated_combination, :shift, :select, :reverse!, :==, :clear, :rotate!, :inspect, :iter_for_each,
   :sort_by!, :compact!, :|, :copy_data_simple, :nitems, :zip, :take, :rassoc, :flatten!, :join, :compact, :[]=,
   :frozen?, :slice!, :drop_while, :reverse_each, :shuffle, :slice, :reverse, :insert, :uniq, :first, :count, :fetch,
   :hash, :to_ary, :find_index, :replace, :-, :product, :iter_for_reverse_each, :pop, :push, :sort, :fill, :uniq!,
   :length, :&, :flatten, :repeated_permutation, :[], :shuffle!, :sort!, :sample, :include?, :<<, :dimensions,
   :collect, :+, :rindex, :<=>, :eql?, :indices, :collect!, :iter_for_each_index, :iter_for_each_with_index, :index,
   :*, :indexes, :copy_data, :delete, :to_s, :assoc, :delete_at, :unshift, :delete_if, :empty?, :reject!, :last,
   :size, :concat, :map!, :at, :each_index, :transpose, :values_at, :each, :enum_cons, :group_by, :enum_with_index,
   :entries, :with_object, :chunk, :each_with_index, :min, :inject, :one?, :partition, :enum_slice, :none?, :max_by,
   :any?, :flat_map, :reduce, :each_entry, :find, :minmax_by, :collect_concat, :each_cons, :member?, :max, :sort_by,
   :detect, :all?, :minmax, :grep, :each_with_object, :find_all]
end

Instance Method Details

#averageObject



17
18
19
# File 'lib/quandl/operation/core_ext/array.rb', line 17

def average
  sum / count
end

#extract_optionsObject



21
22
23
# File 'lib/quandl/operation/core_ext/array.rb', line 21

def extract_options
  last.is_a?(::Hash) ? last : {}
end