Class: Warped::Filter::Factory

Inherits:
Object
  • Object
show all
Defined in:
lib/warped/api/filter/factory.rb

Constant Summary collapse

TYPES =
%i[string integer float decimal date time date_time boolean].freeze

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(kind = nil) ⇒ Factory

Returns a new instance of Factory.



12
13
14
15
# File 'lib/warped/api/filter/factory.rb', line 12

def initialize(kind = nil)
  @kind = kind
  validate_kind!
end

Class Method Details

.build(kind, *args, **kwargs) ⇒ Object



8
9
10
# File 'lib/warped/api/filter/factory.rb', line 8

def self.build(kind, *args, **kwargs)
  new(kind).build(*args, **kwargs)
end

Instance Method Details

#build(*args, **kwargs) ⇒ Object



17
18
19
# File 'lib/warped/api/filter/factory.rb', line 17

def build(*args, **kwargs)
  filter_class.new(*args, **kwargs)
end