Class: ActiveSchema::FilteredSchemaReader
- Inherits:
-
Object
- Object
- ActiveSchema::FilteredSchemaReader
- Defined in:
- lib/active_schema/schema_feeder.rb
Instance Method Summary collapse
- #evaluate ⇒ Object
- #filtered_lines ⇒ Object
-
#initialize(schema_feeder, schema) ⇒ FilteredSchemaReader
constructor
A new instance of FilteredSchemaReader.
Constructor Details
#initialize(schema_feeder, schema) ⇒ FilteredSchemaReader
Returns a new instance of FilteredSchemaReader.
5 6 7 8 |
# File 'lib/active_schema/schema_feeder.rb', line 5 def initialize(schema_feeder, schema) @schema_feeder = schema_feeder @schema = schema end |
Instance Method Details
#evaluate ⇒ Object
14 15 16 |
# File 'lib/active_schema/schema_feeder.rb', line 14 def evaluate @schema_feeder.instance_eval(filtered_lines*"\n") end |
#filtered_lines ⇒ Object
10 11 12 |
# File 'lib/active_schema/schema_feeder.rb', line 10 def filtered_lines @schema.split.grep /^\s*(add_index|add_foreign_key)/ end |