Class: Shift::Builder::DBModel

Inherits:
Object
  • Object
show all
Defined in:
lib/shift-lang/builder/db_model.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#attributesObject

Returns the value of attribute attributes.



4
5
6
# File 'lib/shift-lang/builder/db_model.rb', line 4

def attributes
  @attributes
end

#nameObject

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