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.
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
#attributes ⇒ Object (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 |
#fields ⇒ Object (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 |
#name ⇒ Object (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 |
#inspect ⇒ Object
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_s ⇒ Object
195 196 197 |
# File 'lib/spiderfw/model/storage/db/db_schema.rb', line 195 def to_s @name end |