Class: SolrMakr::CoreName Private

Inherits:
Virtus::Attribute
  • Object
show all
Defined in:
lib/solr_makr/core.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Constant Summary collapse

NAME_FORMAT =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

/\A[\w\-]+\z/i

Instance Method Summary collapse

Instance Method Details

#coerce(value) ⇒ String

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parameters:

  • value (String)

Returns:

  • (String)


8
9
10
11
12
13
14
15
# File 'lib/solr_makr/core.rb', line 8

def coerce(value)
  value = value.to_s

  raise 'Invalid Core Name' unless value.present?
  raise 'Invalid Core Name Format' unless value =~ NAME_FORMAT

  return value
end