Class: Solr::CoreConfiguration::CoreConfig
- Inherits:
-
Object
- Object
- Solr::CoreConfiguration::CoreConfig
- Defined in:
- lib/solr/core_configuration/core_config.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#fields ⇒ Object
readonly
Returns the value of attribute fields.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #default? ⇒ Boolean
- #field_by_name(field_name) ⇒ Object
-
#initialize(name:, fields:, default:) ⇒ CoreConfig
constructor
A new instance of CoreConfig.
- #uri ⇒ Object
- #url ⇒ Object
Constructor Details
#initialize(name:, fields:, default:) ⇒ CoreConfig
Returns a new instance of CoreConfig.
6 7 8 9 10 |
# File 'lib/solr/core_configuration/core_config.rb', line 6 def initialize(name:, fields:, default:) @name = name @fields = fields @default = default end |
Instance Attribute Details
#fields ⇒ Object (readonly)
Returns the value of attribute fields.
4 5 6 |
# File 'lib/solr/core_configuration/core_config.rb', line 4 def fields @fields end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/solr/core_configuration/core_config.rb', line 4 def name @name end |
Instance Method Details
#default? ⇒ Boolean
16 17 18 |
# File 'lib/solr/core_configuration/core_config.rb', line 16 def default? @default end |
#field_by_name(field_name) ⇒ Object
12 13 14 |
# File 'lib/solr/core_configuration/core_config.rb', line 12 def field_by_name(field_name) fields[field_name.to_sym] end |
#uri ⇒ Object
24 25 26 |
# File 'lib/solr/core_configuration/core_config.rb', line 24 def uri @uri ||= Addressable::URI.parse(url) end |
#url ⇒ Object
20 21 22 |
# File 'lib/solr/core_configuration/core_config.rb', line 20 def url @url ||= File.join(Solr.configuration.url || ENV['SOLR_URL'], name.to_s).chomp('/') end |