Class: GroongaClientModel::Migrator::Definition
- Inherits:
-
Object
- Object
- GroongaClientModel::Migrator::Definition
- Defined in:
- lib/groonga_client_model/migrator.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
- #create_migration(client) ⇒ Object
-
#initialize(path) ⇒ Definition
constructor
A new instance of Definition.
- #valid? ⇒ Boolean
Constructor Details
#initialize(path) ⇒ Definition
Returns a new instance of Definition.
214 215 216 217 |
# File 'lib/groonga_client_model/migrator.rb', line 214 def initialize(path) @path = path parse_path end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
213 214 215 |
# File 'lib/groonga_client_model/migrator.rb', line 213 def name @name end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
212 213 214 |
# File 'lib/groonga_client_model/migrator.rb', line 212 def version @version end |
Instance Method Details
#create_migration(client) ⇒ Object
223 224 225 226 |
# File 'lib/groonga_client_model/migrator.rb', line 223 def create_migration(client) require(@path) @name.camelize.constantize.new(client) end |
#valid? ⇒ Boolean
219 220 221 |
# File 'lib/groonga_client_model/migrator.rb', line 219 def valid? @version and @name and File.exist?(@path) end |