Class: ActiveMocker::CreateTable
- Inherits:
-
Object
- Object
- ActiveMocker::CreateTable
- Defined in:
- lib/active_mocker/active_record/schema.rb
Instance Attribute Summary collapse
-
#fields ⇒ Object
readonly
Returns the value of attribute fields.
Instance Method Summary collapse
- #base_field(type, args) ⇒ Object
-
#initialize ⇒ CreateTable
constructor
A new instance of CreateTable.
- #method_missing(meth, *args) ⇒ Object
Constructor Details
#initialize ⇒ CreateTable
Returns a new instance of CreateTable.
65 66 67 |
# File 'lib/active_mocker/active_record/schema.rb', line 65 def initialize @fields = [] end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(meth, *args) ⇒ Object
69 70 71 |
# File 'lib/active_mocker/active_record/schema.rb', line 69 def method_missing(meth, *args) base_field meth, args end |
Instance Attribute Details
#fields ⇒ Object (readonly)
Returns the value of attribute fields.
63 64 65 |
# File 'lib/active_mocker/active_record/schema.rb', line 63 def fields @fields end |
Instance Method Details
#base_field(type, args) ⇒ Object
73 74 75 |
# File 'lib/active_mocker/active_record/schema.rb', line 73 def base_field(type, args) fields << ActiveRecord::Field.new(args.shift, type, args) end |