Class: Liquigen::Handlers::Base
- Inherits:
-
Object
- Object
- Liquigen::Handlers::Base
- Defined in:
- lib/liquigen/handlers/base.rb
Direct Known Subclasses
ChangeType, CreateTable, DropTable, RenameColumn, RenameTable, Sql
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#props ⇒ Object
Returns the value of attribute props.
-
#sets ⇒ Object
Returns the value of attribute sets.
-
#table ⇒ Object
Returns the value of attribute table.
Instance Method Summary collapse
-
#initialize(table, props) ⇒ Base
constructor
A new instance of Base.
- #process ⇒ Object
Constructor Details
#initialize(table, props) ⇒ Base
Returns a new instance of Base.
17 18 19 20 21 22 23 |
# File 'lib/liquigen/handlers/base.rb', line 17 def initialize(table, props) self.table = table self.props = props self.sets = [] self.id = build_id end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
15 16 17 |
# File 'lib/liquigen/handlers/base.rb', line 15 def id @id end |
#props ⇒ Object
Returns the value of attribute props.
12 13 14 |
# File 'lib/liquigen/handlers/base.rb', line 12 def props @props end |
#sets ⇒ Object
Returns the value of attribute sets.
13 14 15 |
# File 'lib/liquigen/handlers/base.rb', line 13 def sets @sets end |
#table ⇒ Object
Returns the value of attribute table.
11 12 13 |
# File 'lib/liquigen/handlers/base.rb', line 11 def table @table end |
Instance Method Details
#process ⇒ Object
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/liquigen/handlers/base.rb', line 25 def process set = Liquigen::ChangeSet.new(id) build_one_changeset(set) sets << set file_path = build_file_name File.open(file_path, 'w+') { |f| f.write(sets.to_yaml(indentation: 4)) } process_lines file_path end |