module Mockingjay::Generator
Eventually this should start searching through a folder of other fixtures to see if they know how to make an object.
Takes Generator
hooks in serialized data and returns values.
Public Class Methods
fixnum(str_range)
click to toggle source
# File lib/mockingjay/generators/base_generators.rb, line 10 def fixnum(str_range) a, b = *str_range.split(/...?/).map(&:to_i) b ? rand(a..b).to_i : rand(a).to_i end
float(str_range)
click to toggle source
# File lib/mockingjay/generators/base_generators.rb, line 15 def float(str_range) a, b = *str_range.split(/...?/).map(&:to_i) b ? rand(a..b) : rand(a) end
string(type = 'Lorem.word')
click to toggle source
Anything that you can use in faker, you can use here.
# File lib/mockingjay/generators/base_generators.rb, line 23 def string(type = 'Lorem.word') self.instance_eval type end
unknown(type)
click to toggle source
def time(str_range)
a, b = *str_range.split('..') b ? time_rand(a,b) : time_rand(a)
end
# File lib/mockingjay/generators/base_generators.rb, line 36 def unknown(type) "Unknown Generator Type #{type}" end