Class: Super::Filter::Guesser

Inherits:
Object
  • Object
show all
Defined in:
lib/super/filter/guesser.rb

Instance Method Summary collapse

Constructor Details

#initialize(model:, fields:, type:) ⇒ Guesser

Returns a new instance of Guesser.



6
7
8
9
10
# File 'lib/super/filter/guesser.rb', line 6

def initialize(model:, fields:, type:)
  @model = model
  @fields = fields
  @type = type
end

Instance Method Details

#callObject



12
13
14
15
16
17
# File 'lib/super/filter/guesser.rb', line 12

def call
  Schema::Guesser
    .new(model: @model, fields: @fields, type: @type)
    .assign_type { |attribute_name| attribute_type_for(attribute_name) }
    .call
end