Exception: GroongaClientModel::IllegalMigrationNameError

Inherits:
MigrationError show all
Defined in:
lib/groonga_client_model/migration.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ IllegalMigrationNameError

Returns a new instance of IllegalMigrationNameError.



39
40
41
42
43
44
# File 'lib/groonga_client_model/migration.rb', line 39

def initialize(name)
  @name = name
  message = "Illegal name for migration file: #{name}\n"
  message << "\t(only lower case letters, numbers, and '_' allowed)."
  super(message)
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



38
39
40
# File 'lib/groonga_client_model/migration.rb', line 38

def name
  @name
end

Class Method Details

.validate(name) ⇒ Object



28
29
30
31
32
33
34
35
# File 'lib/groonga_client_model/migration.rb', line 28

def validate(name)
  case name
  when /\A[_a-z0-9]+\z/
    # OK
  else
    raise new(name)
  end
end