Module: Generator

Defined in:
bin/finexclub_updater

Defined Under Namespace

Classes: Alpha, Octopus, Prognosis, Zeta

Class Method Summary collapse

Class Method Details

.allObject



17
18
19
# File 'bin/finexclub_updater', line 17

def all
  constants.map { |e| e.downcase }
end

.get(gen) ⇒ Object



12
13
14
15
# File 'bin/finexclub_updater', line 12

def get(gen)
  class_name = gen.to_s.gsub(/^(.)/) { $1.upcase }
  const_get(class_name).new
end

.rand_array(arr) ⇒ Object



30
31
32
# File 'bin/finexclub_updater', line 30

def rand_array(arr)
  arr[rand(arr.length)] 
end

.rand_indexObject



26
27
28
# File 'bin/finexclub_updater', line 26

def rand_index
  rand(100) 
end

.rand_price(n = nil) ⇒ Object



21
22
23
24
# File 'bin/finexclub_updater', line 21

def rand_price(n = nil)
  n ||= 10000
  rand(n)/n.to_f
end