Class: Fakerjp::Helper

Inherits:
Object
  • Object
show all
Defined in:
lib/fakerjp/helper.rb

Class Method Summary collapse

Class Method Details

.fetcher(module_name, method_name) ⇒ Object



8
9
10
11
12
# File 'lib/fakerjp/helper.rb', line 8

def fetcher(module_name, method_name)
  data = YAML.load_file("#{File.dirname(__FILE__)}/data/#{module_name}.yml")[method_name]
  index = rand(0..(data.length-1))
  data[index]
end