Class: Sunspot::FieldFactory::Join
- Defined in:
- lib/sunspot/field_factory.rb
Instance Attribute Summary
Attributes inherited from Abstract
Instance Method Summary collapse
-
#build ⇒ Object
Return the field instance built by this factory.
-
#initialize(name, type, options = {}, &block) ⇒ Join
constructor
A new instance of Join.
-
#signature ⇒ Object
A unique signature identifying this field by name and type.
Methods inherited from Abstract
Constructor Details
#initialize(name, type, options = {}, &block) ⇒ Join
Returns a new instance of Join.
102 103 104 105 106 107 108 |
# File 'lib/sunspot/field_factory.rb', line 102 def initialize(name, type, = {}, &block) super([:prefix] ? "#{options[:prefix]}_#{name}" : name, , &block) unless name.to_s =~ /^\w+$/ raise ArgumentError, "Invalid field name #{name}: only letters, numbers, and underscores are allowed." end @field = JoinField.new(self.name, type, ) end |
Instance Method Details
#build ⇒ Object
Return the field instance built by this factory
113 114 115 |
# File 'lib/sunspot/field_factory.rb', line 113 def build @field end |
#signature ⇒ Object
A unique signature identifying this field by name and type.
120 121 122 |
# File 'lib/sunspot/field_factory.rb', line 120 def signature ['join', @field.name, @field.type] end |