Class: Solr::CoreConfiguration::Field

Inherits:
Object
  • Object
show all
Defined in:
lib/solr/core_configuration/field.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, dynamic_field: nil, solr_name: nil) ⇒ Field

Returns a new instance of Field.



6
7
8
9
10
11
# File 'lib/solr/core_configuration/field.rb', line 6

def initialize(name:, dynamic_field: nil, solr_name: nil)
  @name = name
  @dynamic_field = dynamic_field
  @solr_name = solr_name
  freeze
end

Instance Attribute Details

#dynamic_fieldObject (readonly)

Returns the value of attribute dynamic_field.



4
5
6
# File 'lib/solr/core_configuration/field.rb', line 4

def dynamic_field
  @dynamic_field
end

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/solr/core_configuration/field.rb', line 4

def name
  @name
end

#solr_nameObject (readonly)

Returns the value of attribute solr_name.



4
5
6
# File 'lib/solr/core_configuration/field.rb', line 4

def solr_name
  @solr_name
end

Instance Method Details

#solr_field_nameObject



13
14
15
16
17
# File 'lib/solr/core_configuration/field.rb', line 13

def solr_field_name
  return solr_name.to_s if solr_name
  return dynamic_field.build(name) if dynamic_field
  name.to_s
end