Class: ActiveMocker::CreateTable

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCreateTable

Returns a new instance of CreateTable.



67
68
69
# File 'lib/active_mocker/active_record/schema.rb', line 67

def initialize
  @fields = []
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth, *args) ⇒ Object



71
72
73
# File 'lib/active_mocker/active_record/schema.rb', line 71

def method_missing(meth, *args)
  base_field meth, args
end

Instance Attribute Details

#fieldsObject (readonly)

Returns the value of attribute fields.



65
66
67
# File 'lib/active_mocker/active_record/schema.rb', line 65

def fields
  @fields
end

Instance Method Details

#base_field(type, args) ⇒ Object



75
76
77
# File 'lib/active_mocker/active_record/schema.rb', line 75

def base_field(type, args)
  fields << Field.new(args.shift, type, args)
end