Class: Spider::Model::Storage::Db::Table

Inherits:
Object
  • Object
show all
Defined in:
lib/spiderfw/model/storage/db/db_schema.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, attributes = {}) ⇒ Table

Returns a new instance of Table.



185
186
187
188
189
# File 'lib/spiderfw/model/storage/db/db_schema.rb', line 185

def initialize(name, attributes={})
    @name = name
    @attributes = attributes
    @fields = []
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



183
184
185
# File 'lib/spiderfw/model/storage/db/db_schema.rb', line 183

def attributes
  @attributes
end

#fieldsObject (readonly)

Returns the value of attribute fields.



183
184
185
# File 'lib/spiderfw/model/storage/db/db_schema.rb', line 183

def fields
  @fields
end

#nameObject (readonly)

Returns the value of attribute name.



183
184
185
# File 'lib/spiderfw/model/storage/db/db_schema.rb', line 183

def name
  @name
end

Instance Method Details

#add_field(field) ⇒ Object



191
192
193
# File 'lib/spiderfw/model/storage/db/db_schema.rb', line 191

def add_field(field)
    @fields << field
end

#inspectObject



199
200
201
# File 'lib/spiderfw/model/storage/db/db_schema.rb', line 199

def inspect
    "#<#{self.class.name}:#{self.object_id} @name=\"#{@name}\ >"
end

#to_sObject



195
196
197
# File 'lib/spiderfw/model/storage/db/db_schema.rb', line 195

def to_s
    @name
end