More beautify
This commit is contained in:
parent
ea228d9285
commit
c81e3d7399
18
lol.rb
18
lol.rb
|
@ -38,9 +38,7 @@ def construct_class(name_of_class, parameters, to_string_template, sorting_filte
|
||||||
end
|
end
|
||||||
|
|
||||||
(0...parameters.length).each do |x|
|
(0...parameters.length).each do |x|
|
||||||
pls = '" + '
|
pls = "\" + #{parameters[x][:name]} + \""
|
||||||
pls += parameters[x][:name]
|
|
||||||
pls += '+ "'
|
|
||||||
to_string_template.sub! "#{x}", pls
|
to_string_template.sub! "#{x}", pls
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -70,18 +68,10 @@ end
|
||||||
def construct_driver(class_name, parameters, methods, container_class, container_params)
|
def construct_driver(class_name, parameters, methods, container_class, container_params)
|
||||||
|
|
||||||
def args(parameters)
|
def args(parameters)
|
||||||
tmp = parameters.map do |x|
|
parameters.map do |x|
|
||||||
type = x[:type]
|
type = x[:type]
|
||||||
|
type == "int" ? "#{rand(max=100)}" : "\"#{(0...10).map { ('a'..'z').to_a[rand(26)] }.join}\""
|
||||||
res_string = ""
|
end.join ","
|
||||||
if type == "int"
|
|
||||||
res_string += "#{rand(max=100)}"
|
|
||||||
else
|
|
||||||
res_string += '"' + (0...10).map { ('a'..'z').to_a[rand(26)] }.join + '"'
|
|
||||||
end
|
|
||||||
res_string
|
|
||||||
end
|
|
||||||
tmp.join ","
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user