Class: Groonga::Schema::ColumnRemoveDefinition
- Inherits:
-
Object
- Object
- Groonga::Schema::ColumnRemoveDefinition
- Includes:
- Path
- Defined in:
- lib/groonga/schema.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #define(table_definition, table) ⇒ Object
-
#initialize(name, options = {}) ⇒ ColumnRemoveDefinition
constructor
A new instance of ColumnRemoveDefinition.
Methods included from Path
#columns_directory_path, #rmdir_if_available, #tables_directory_path
Constructor Details
#initialize(name, options = {}) ⇒ ColumnRemoveDefinition
Returns a new instance of ColumnRemoveDefinition.
1594 1595 1596 1597 1598 |
# File 'lib/groonga/schema.rb', line 1594 def initialize(name, ={}) @name = name @name = @name.to_s if @name.is_a?(Symbol) = ( || {}).dup end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
1591 1592 1593 |
# File 'lib/groonga/schema.rb', line 1591 def name @name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
1592 1593 1594 |
# File 'lib/groonga/schema.rb', line 1592 def end |
Instance Method Details
#define(table_definition, table) ⇒ Object
1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 |
# File 'lib/groonga/schema.rb', line 1600 def define(table_definition, table) if @name.respond_to?(:call) name = @name.call(table_definition.context) else name = @name end column = table.column(name) if column.nil? raise ColumnNotExists.new(name) end result = column.remove columns_dir = columns_directory_path(table) rmdir_if_available(columns_dir) result end |