I write the gem, it's the addition to faker
gem (with russian functions like tax & vat et.c.)
So, I have a trouble: every piece of code is big, so I need to split it to logical parts.
IE I have Inn
functionality to be called as Faker::Russian.inn()
So, I write
Dir['faker/russian/*.rb'].each { |file| require file }
module Faker
class Russian
extend Inn
end
end
Else I have (at faker/russian/inn.rb
) (which is required) this file
module Inn
def inn ; puts 'inn goes here' ; end
end
But I have an error: lib/faker/russian.rb:5:in <class:Russian>': uninitialized constant Faker::Russian::Inn (NameError)
How can I avoid this error and successfully include code and extend
all connected modules automatically?