Class: ActiveMocker::ActiveRecord::SchemaParser

Inherits:
Object
  • Object
show all
Defined in:
lib/active_mocker/active_record/schema.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_searchObject (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

#tablesObject (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, options={}, &block)
  tables << ActiveMocker::Table.new(name, CreateTable.new.instance_eval(&block)) if name == table_search
end