class MakeData::FakerFinder

Attributes

category[RW]

Public Class Methods

available_categories() click to toggle source
# File lib/make_data.rb, line 16
def self.available_categories
  Faker.constants - [:Config, :VERSION, :Base, :UniqueGenerator]
end
new(category) click to toggle source
# File lib/make_data.rb, line 11
def initialize(category)
  @category = category
  raise ArgumentError.new("Invalid Category") unless Faker.const_get(@category)
end

Public Instance Methods

available_methods() click to toggle source
# File lib/make_data.rb, line 24
def available_methods
  klass.methods - klass.superclass.methods
end
klass() click to toggle source
# File lib/make_data.rb, line 20
def klass
  Faker.const_get(@category)
end