Class: Txdb::Table
- Inherits:
-
Object
- Object
- Txdb::Table
- Defined in:
- lib/txdb/table.rb
Instance Attribute Summary collapse
-
#columns ⇒ Object
readonly
Returns the value of attribute columns.
-
#database ⇒ Object
readonly
Returns the value of attribute database.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #connection ⇒ Object
-
#initialize(database, options = {}) ⇒ Table
constructor
A new instance of Table.
- #read_content ⇒ Object
- #write_content(resource, locale) ⇒ Object
Constructor Details
#initialize(database, options = {}) ⇒ Table
Returns a new instance of Table.
7 8 9 10 11 |
# File 'lib/txdb/table.rb', line 7 def initialize(database, = {}) @database = database @name = .fetch(:name) @columns = .fetch(:columns) end |
Instance Attribute Details
#columns ⇒ Object (readonly)
Returns the value of attribute columns.
5 6 7 |
# File 'lib/txdb/table.rb', line 5 def columns @columns end |
#database ⇒ Object (readonly)
Returns the value of attribute database.
5 6 7 |
# File 'lib/txdb/table.rb', line 5 def database @database end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/txdb/table.rb', line 5 def name @name end |
Instance Method Details
#connection ⇒ Object
13 14 15 |
# File 'lib/txdb/table.rb', line 13 def connection database.connection.from(name) end |
#read_content ⇒ Object
17 18 19 |
# File 'lib/txdb/table.rb', line 17 def read_content database.backend.read_content_from(self) end |
#write_content(resource, locale) ⇒ Object
21 22 23 |
# File 'lib/txdb/table.rb', line 21 def write_content(resource, locale) database.backend.write_content_to(self, resource, locale) end |