Class: Druid::Dimension
- Inherits:
-
Object
- Object
- Druid::Dimension
- Includes:
- ActiveModel::Model
- Defined in:
- lib/druid/dimension.rb
Defined Under Namespace
Classes: ExtractionFnValidator
Instance Attribute Summary collapse
-
#dimension ⇒ Object
Returns the value of attribute dimension.
-
#extractionFn ⇒ Object
Returns the value of attribute extractionFn.
-
#outputName ⇒ Object
Returns the value of attribute outputName.
-
#type ⇒ Object
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
- #as_json(options = {}) ⇒ Object
-
#initialize(params) ⇒ Dimension
constructor
A new instance of Dimension.
Constructor Details
#initialize(params) ⇒ Dimension
Returns a new instance of Dimension.
28 29 30 31 32 33 34 |
# File 'lib/druid/dimension.rb', line 28 def initialize(params) if params.is_a?(Hash) super else super(type: 'default', dimension: params.to_s, outputName: params.to_s) end end |
Instance Attribute Details
#dimension ⇒ Object
Returns the value of attribute dimension.
8 9 10 |
# File 'lib/druid/dimension.rb', line 8 def dimension @dimension end |
#extractionFn ⇒ Object
Returns the value of attribute extractionFn.
25 26 27 |
# File 'lib/druid/dimension.rb', line 25 def extractionFn @extractionFn end |
#outputName ⇒ Object
Returns the value of attribute outputName.
11 12 13 |
# File 'lib/druid/dimension.rb', line 11 def outputName @outputName end |
#type ⇒ Object
Returns the value of attribute type.
5 6 7 |
# File 'lib/druid/dimension.rb', line 5 def type @type end |
Class Method Details
.lookup(dimension, namespace, outputName: nil, retain: true, injective: false) ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/druid/dimension.rb', line 40 def self.lookup(dimension, namespace, outputName: nil, retain: true, injective: false) new({ type: 'extraction', dimension: dimension, outputName: outputName || namespace, extractionFn: { type: 'registeredLookup', lookup: namespace, retainMissingValue: retain, injective: injective, }, }) end |
Instance Method Details
#as_json(options = {}) ⇒ Object
36 37 38 |
# File 'lib/druid/dimension.rb', line 36 def as_json( = {}) super(.merge(except: %w(errors validation_context))) end |