Class: ConcurrentPipeline::Stores::Schema::RecordContext
- Inherits:
-
Object
- Object
- ConcurrentPipeline::Stores::Schema::RecordContext
- Defined in:
- lib/concurrent_pipeline/stores/schema.rb
Instance Attribute Summary collapse
-
#schema_instance ⇒ Object
readonly
Returns the value of attribute schema_instance.
-
#table_name ⇒ Object
readonly
Returns the value of attribute table_name.
Instance Method Summary collapse
-
#initialize(schema_instance) ⇒ RecordContext
constructor
A new instance of RecordContext.
- #method_missing ⇒ Object
- #respond_to_missing? ⇒ Boolean
- #schema(table_name, &block) ⇒ Object
Constructor Details
#initialize(schema_instance) ⇒ RecordContext
Returns a new instance of RecordContext.
10 11 12 13 |
# File 'lib/concurrent_pipeline/stores/schema.rb', line 10 def initialize(schema_instance) @schema_instance = schema_instance @table_name = nil end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing ⇒ Object
28 29 |
# File 'lib/concurrent_pipeline/stores/schema.rb', line 28 def method_missing(...) end |
Instance Attribute Details
#schema_instance ⇒ Object (readonly)
Returns the value of attribute schema_instance.
8 9 10 |
# File 'lib/concurrent_pipeline/stores/schema.rb', line 8 def schema_instance @schema_instance end |
#table_name ⇒ Object (readonly)
Returns the value of attribute table_name.
8 9 10 |
# File 'lib/concurrent_pipeline/stores/schema.rb', line 8 def table_name @table_name end |
Instance Method Details
#respond_to_missing? ⇒ Boolean
31 32 33 |
# File 'lib/concurrent_pipeline/stores/schema.rb', line 31 def respond_to_missing?(...) true end |
#schema(table_name, &block) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/concurrent_pipeline/stores/schema.rb', line 15 def schema(table_name, &block) # Store the table name for later use @table_name = table_name # Prepend schema migrations to front of the line # Wrap the block in a create_table call migration_block = Proc.new do create_table(table_name, &block) end schema_instance.prepend_migration(table_name, &migration_block) end |