Class: Faker::Bot::Reflector Abstract Private

Inherits:
Object
  • Object
show all
Defined in:
lib/faker/bot/reflector.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

This class is abstract.

‘Faker::Base` Reflection object

  • Introspects the ‘Faker::Base` class and it’s descendants

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeReflector

Initialize the reflector



64
65
66
# File 'lib/faker/bot/reflector.rb', line 64

def initialize(*)
  @descendants_with_methods = Hash.new { |h, k| h[k] = [] }
end

Instance Attribute Details

#descendants_with_methodsHash[Class => [Array<Symbol>]] (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns Hash[Class => [Array<Symbol>]].

Examples:

Faker::Base subclasses with their methods

{ Faker::Marketing => [:buzzwords], Faker::Artist => [:name] }

Returns:

  • (Hash[Class => [Array<Symbol>]])

    Hash[Class => [Array<Symbol>]]



47
48
49
# File 'lib/faker/bot/reflector.rb', line 47

def descendants_with_methods
  @descendants_with_methods
end

Class Method Details

.call(*args) ⇒ Object

Alternate constructor

See Also:



56
57
58
# File 'lib/faker/bot/reflector.rb', line 56

def self.call(*args)
  new(*args).call
end