Class: Solr::CoreConfiguration::EnvUrlCoreConfig

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from CoreConfig

#default?, #field_by_name, #uri

Constructor Details

#initialize(name: nil, fields: {}) ⇒ EnvUrlCoreConfig

Returns a new instance of EnvUrlCoreConfig.



32
33
34
35
36
# File 'lib/solr/core_configuration/core_config.rb', line 32

def initialize(name: nil, fields: {})
  @name = name
  @fields = fields
  @default = false
end

Instance Attribute Details

#fieldsObject (readonly)

Returns the value of attribute fields.



30
31
32
# File 'lib/solr/core_configuration/core_config.rb', line 30

def fields
  @fields
end

#nameObject (readonly)

Returns the value of attribute name.



30
31
32
# File 'lib/solr/core_configuration/core_config.rb', line 30

def name
  @name
end

Instance Method Details

#urlObject

Raises:

  • (ArgumentError)


38
39
40
41
# File 'lib/solr/core_configuration/core_config.rb', line 38

def url
  raise ArgumentError, "Solr URL can't be nil" if ENV['SOLR_URL'].nil?
  ENV['SOLR_URL']
end