Class: Druid::Filter

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Model
Defined in:
lib/druid/filter.rb

Defined Under Namespace

Classes: DimensionValidator, FieldValidator, FieldsValidator, FunctionValidator, PatternValidator, ValueValidator

Instance Attribute Summary collapse

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args) ⇒ Object



130
131
132
# File 'lib/druid/filter.rb', line 130

def method_missing(name, *args)
  DimensionFilter.new(dimension: name)
end

Instance Attribute Details

#dimensionObject

Returns the value of attribute dimension.



19
20
21
# File 'lib/druid/filter.rb', line 19

def dimension
  @dimension
end

#fieldObject

Returns the value of attribute field.



101
102
103
# File 'lib/druid/filter.rb', line 101

def field
  @field
end

#fieldsObject

Returns the value of attribute fields.



66
67
68
# File 'lib/druid/filter.rb', line 66

def fields
  @fields
end

#functionObject

Returns the value of attribute function.



123
124
125
# File 'lib/druid/filter.rb', line 123

def function
  @function
end

#patternObject

Returns the value of attribute pattern.



47
48
49
# File 'lib/druid/filter.rb', line 47

def pattern
  @pattern
end

#typeObject

Returns the value of attribute type.



5
6
7
# File 'lib/druid/filter.rb', line 5

def type
  @type
end

#valueObject

Returns the value of attribute value.



33
34
35
# File 'lib/druid/filter.rb', line 33

def value
  @value
end

Instance Method Details

#as_json(options = {}) ⇒ Object



126
127
128
# File 'lib/druid/filter.rb', line 126

def as_json(options = {})
  super(options.merge(except: %w(errors validation_context)))
end