Class: ActiveMocker::ActiveRecord::SchemaParser
- Inherits:
-
Object
- Object
- ActiveMocker::ActiveRecord::SchemaParser
- Defined in:
- lib/active_mocker/active_record/schema.rb
Instance Attribute Summary collapse
-
#table_search ⇒ Object
readonly
Returns the value of attribute table_search.
-
#tables ⇒ Object
readonly
Returns the value of attribute tables.
Instance Method Summary collapse
- #create_table(name, options = {}, &block) ⇒ Object
-
#initialize(table_search) ⇒ SchemaParser
constructor
A new instance of SchemaParser.
- #method_missing(meth, *args) ⇒ Object
Constructor Details
#initialize(table_search) ⇒ SchemaParser
46 47 48 49 50 |
# File 'lib/active_mocker/active_record/schema.rb', line 46 def initialize(table_search) @table_search = table_search @tables = [] end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(meth, *args) ⇒ Object
56 57 |
# File 'lib/active_mocker/active_record/schema.rb', line 56 def method_missing(meth, *args) end |
Instance Attribute Details
#table_search ⇒ Object (readonly)
Returns the value of attribute table_search.
44 45 46 |
# File 'lib/active_mocker/active_record/schema.rb', line 44 def table_search @table_search end |
#tables ⇒ Object (readonly)
Returns the value of attribute tables.
44 45 46 |
# File 'lib/active_mocker/active_record/schema.rb', line 44 def tables @tables end |
Instance Method Details
#create_table(name, options = {}, &block) ⇒ Object
52 53 54 |
# File 'lib/active_mocker/active_record/schema.rb', line 52 def create_table(name, ={}, &block) tables << ActiveMocker::Table.new(name, CreateTable.new.instance_eval(&block)) if name == table_search end |