Class: Witsec::Table
- Inherits:
-
Object
- Object
- Witsec::Table
- Defined in:
- lib/witsec/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
- #column(column_name, using: nil) ⇒ Object
- #define(&block) ⇒ Object
-
#initialize(name) ⇒ Table
constructor
A new instance of Table.
Constructor Details
#initialize(name) ⇒ Table
Returns a new instance of Table.
53 54 55 56 |
# File 'lib/witsec/schema.rb', line 53 def initialize(name) @name = name @columns = [] end |
Instance Attribute Details
#columns ⇒ Object (readonly)
Returns the value of attribute columns.
58 59 60 |
# File 'lib/witsec/schema.rb', line 58 def columns @columns end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
58 59 60 |
# File 'lib/witsec/schema.rb', line 58 def name @name end |
Instance Method Details
#column(column_name, using: nil) ⇒ Object
66 67 68 |
# File 'lib/witsec/schema.rb', line 66 def column(column_name, using: nil) columns << [column_name, using] end |
#define(&block) ⇒ Object
60 61 62 63 64 |
# File 'lib/witsec/schema.rb', line 60 def define(&block) instance_eval(&block) self end |