Exception: GroongaClientModel::IllegalMigrationNameError
- Inherits:
-
MigrationError
- Object
- StandardError
- Error
- MigrationError
- GroongaClientModel::IllegalMigrationNameError
- Defined in:
- lib/groonga_client_model/migration.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name) ⇒ IllegalMigrationNameError
constructor
A new instance of IllegalMigrationNameError.
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 = "Illegal name for migration file: #{name}\n" << "\t(only lower case letters, numbers, and '_' allowed)." super() end |
Instance Attribute Details
#name ⇒ Object (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 |