Class: ActiveRecord::Table
- Inherits:
-
Object
- Object
- ActiveRecord::Table
- Defined in:
- lib/forcast/tasks/schema/schema.rb
Instance Attribute Summary collapse
-
#columns ⇒ Object
readonly
Returns the value of attribute columns.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name) ⇒ Table
constructor
A new instance of Table.
- #method_missing(data_type, *column_names_and_options) ⇒ Object
Constructor Details
#initialize(name) ⇒ Table
Returns a new instance of Table.
38 39 40 41 |
# File 'lib/forcast/tasks/schema/schema.rb', line 38 def initialize(name) @name = name @columns = [] end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(data_type, *column_names_and_options) ⇒ Object
43 44 45 46 |
# File 'lib/forcast/tasks/schema/schema.rb', line 43 def method_missing(data_type, *) .pop if .last.is_a?(Hash) @columns += end |
Instance Attribute Details
#columns ⇒ Object (readonly)
Returns the value of attribute columns.
36 37 38 |
# File 'lib/forcast/tasks/schema/schema.rb', line 36 def columns @columns end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
36 37 38 |
# File 'lib/forcast/tasks/schema/schema.rb', line 36 def name @name end |