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.
-
#source_lang ⇒ Object
readonly
Returns the value of attribute source_lang.
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
8 9 10 11 12 13 |
# File 'lib/txdb/table.rb', line 8 def initialize(database, = {}) @database = database @name = .fetch(:name) @columns = .fetch(:columns) @source_lang = .fetch(:source_lang) 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 |
#source_lang ⇒ Object (readonly)
Returns the value of attribute source_lang.
6 7 8 |
# File 'lib/txdb/table.rb', line 6 def source_lang @source_lang end |
Instance Method Details
#connection ⇒ Object
15 16 17 |
# File 'lib/txdb/table.rb', line 15 def connection database.connection.from(name) end |
#read_content ⇒ Object
19 20 21 |
# File 'lib/txdb/table.rb', line 19 def read_content database.backend.read_content_from(self) end |
#write_content(resource, locale) ⇒ Object
23 24 25 |
# File 'lib/txdb/table.rb', line 23 def write_content(resource, locale) database.backend.write_content_to(self, resource, locale) end |