Class: MDB
Overview
require ‘mdb_tools’
Constant Summary
Constants included from MDBTools
MDBTools::BACKENDS, MDBTools::DELIMITER, MDBTools::LINEBREAK, MDBTools::SANITIZER
Instance Attribute Summary collapse
-
#exclude ⇒ Object
readonly
Returns the value of attribute exclude.
-
#mdb_file ⇒ Object
readonly
Returns the value of attribute mdb_file.
-
#prefix ⇒ Object
readonly
Returns the value of attribute prefix.
-
#table_names ⇒ Object
readonly
Returns the value of attribute table_names.
Instance Method Summary collapse
-
#initialize(mdb_file, options = {}) ⇒ MDB
constructor
A new instance of MDB.
- #tables ⇒ Object
Methods included from MDBTools
#arrays_to_hashes, #backends, #check_file, #check_table, #compile_conditions, #delimited_to_arrays, #describe_table, #mdb_export, #mdb_schema, #mdb_sql, #mdb_tables, #mdb_truth, #methodize, #sanitize!, #sql_select, #table_to_csv
Constructor Details
#initialize(mdb_file, options = {}) ⇒ MDB
Returns a new instance of MDB.
8 9 10 11 12 13 14 15 |
# File 'lib/active_mdb/mdb.rb', line 8 def initialize(mdb_file, = {}) @mdb_file = check_file(mdb_file) @prefix = [:prefix] || '' @exclude, @include = [:exclude], [:include] @export_syntax = [:sql_syntax] || 'mysql' @table_names = mdb_tables(@mdb_file, :exclude => @exclude, :include => @include) @tables = create_table_objects end |
Instance Attribute Details
#exclude ⇒ Object (readonly)
Returns the value of attribute exclude.
6 7 8 |
# File 'lib/active_mdb/mdb.rb', line 6 def exclude @exclude end |
#mdb_file ⇒ Object (readonly)
Returns the value of attribute mdb_file.
6 7 8 |
# File 'lib/active_mdb/mdb.rb', line 6 def mdb_file @mdb_file end |
#prefix ⇒ Object (readonly)
Returns the value of attribute prefix.
6 7 8 |
# File 'lib/active_mdb/mdb.rb', line 6 def prefix @prefix end |
#table_names ⇒ Object (readonly)
Returns the value of attribute table_names.
6 7 8 |
# File 'lib/active_mdb/mdb.rb', line 6 def table_names @table_names end |
Instance Method Details
#tables ⇒ Object
17 18 19 |
# File 'lib/active_mdb/mdb.rb', line 17 def tables @table_names.collect { |table| methodize(table)} end |