Class: Column
Constant Summary
Constants included from MDBTools
MDBTools::BACKENDS, MDBTools::DELIMITER, MDBTools::LINEBREAK, MDBTools::SANITIZER
Instance Attribute Summary collapse
-
#method_name ⇒ Object
readonly
Returns the value of attribute method_name.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
- #boolean? ⇒ Boolean
-
#initialize(name, type, size) ⇒ Column
constructor
A new instance of Column.
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(name, type, size) ⇒ Column
Returns a new instance of Column.
6 7 8 9 |
# File 'lib/active_mdb/column.rb', line 6 def initialize(name, type, size) @name = name @method_name, @type, @size = methodize(name), methodize(type), size.to_i end |
Instance Attribute Details
#method_name ⇒ Object (readonly)
Returns the value of attribute method_name.
4 5 6 |
# File 'lib/active_mdb/column.rb', line 4 def method_name @method_name end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/active_mdb/column.rb', line 4 def name @name end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
4 5 6 |
# File 'lib/active_mdb/column.rb', line 4 def size @size end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
4 5 6 |
# File 'lib/active_mdb/column.rb', line 4 def type @type end |
Class Method Details
.new_from_describe(describe_hash) ⇒ Object
11 12 13 |
# File 'lib/active_mdb/column.rb', line 11 def self.new_from_describe(describe_hash) self.new(describe_hash["Column Name"], describe_hash["Type"], describe_hash["Size"]) end |
Instance Method Details
#boolean? ⇒ Boolean
16 17 18 |
# File 'lib/active_mdb/column.rb', line 16 def boolean? self.type == 'boolean' end |