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.



178
179
180
181
182
# File 'lib/spiderfw/model/storage/db/db_schema.rb', line 178

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

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



176
177
178
# File 'lib/spiderfw/model/storage/db/db_schema.rb', line 176

def attributes
  @attributes
end

#fieldsObject (readonly)

Returns the value of attribute fields.



176
177
178
# File 'lib/spiderfw/model/storage/db/db_schema.rb', line 176

def fields
  @fields
end

#nameObject (readonly)

Returns the value of attribute name.



176
177
178
# File 'lib/spiderfw/model/storage/db/db_schema.rb', line 176

def name
  @name
end

Instance Method Details

#add_field(field) ⇒ Object



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

def add_field(field)
    @fields << field
end

#inspectObject



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

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

#to_sObject



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

def to_s
    @name
end