Class: Shift::Builder::DBModel
- Inherits:
-
Object
- Object
- Shift::Builder::DBModel
- Defined in:
- lib/shift-lang/builder/db_model.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #add_attribute(name, type) ⇒ Object
-
#initialize(name) ⇒ DBModel
constructor
A new instance of DBModel.
Constructor Details
#initialize(name) ⇒ DBModel
Returns a new instance of DBModel.
6 7 8 9 |
# File 'lib/shift-lang/builder/db_model.rb', line 6 def initialize(name) @name = name.to_s @attributes = [] end |
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes.
4 5 6 |
# File 'lib/shift-lang/builder/db_model.rb', line 4 def attributes @attributes end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/shift-lang/builder/db_model.rb', line 4 def name @name end |
Instance Method Details
#add_attribute(name, type) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/shift-lang/builder/db_model.rb', line 11 def add_attribute(name, type) attribute = { :name => name.to_s, :type => type.to_s } @attributes.push attribute end |