Class: Spider::Model::Storage::Db::Table
- Defined in:
- lib/spiderfw/model/storage/db/db_schema.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#fields ⇒ Object
readonly
Returns the value of attribute fields.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #add_field(field) ⇒ Object
-
#initialize(name, attributes = {}) ⇒ Table
constructor
A new instance of Table.
- #inspect ⇒ Object
- #to_s ⇒ Object
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
#attributes ⇒ Object (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 |
#fields ⇒ Object (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 |
#name ⇒ Object (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 |
#inspect ⇒ Object
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_s ⇒ Object
188 189 190 |
# File 'lib/spiderfw/model/storage/db/db_schema.rb', line 188 def to_s @name end |