Class: Jackcess::Column
- Inherits:
-
Object
- Object
- Jackcess::Column
- Defined in:
- lib/jackcess/column.rb
Instance Attribute Summary collapse
-
#java_column ⇒ Object
readonly
Returns the value of attribute java_column.
Instance Method Summary collapse
-
#auto_number? ⇒ Boolean
Check if column is auto-number.
-
#initialize(java_column) ⇒ Column
constructor
A new instance of Column.
- #inspect ⇒ Object
-
#length ⇒ Object
Get column length.
-
#name ⇒ Object
Get column name.
-
#properties ⇒ Object
Get column properties.
-
#sql_type ⇒ Object
Get column SQL type.
- #to_s ⇒ Object
-
#type ⇒ Object
Get column type as Ruby symbol.
-
#variable_length? ⇒ Boolean
Check if column is variable length.
Constructor Details
#initialize(java_column) ⇒ Column
Returns a new instance of Column.
7 8 9 |
# File 'lib/jackcess/column.rb', line 7 def initialize(java_column) @java_column = java_column end |
Instance Attribute Details
#java_column ⇒ Object (readonly)
Returns the value of attribute java_column.
5 6 7 |
# File 'lib/jackcess/column.rb', line 5 def java_column @java_column end |
Instance Method Details
#auto_number? ⇒ Boolean
Check if column is auto-number
32 33 34 |
# File 'lib/jackcess/column.rb', line 32 def auto_number? @java_column.is_auto_number end |
#inspect ⇒ Object
53 54 55 |
# File 'lib/jackcess/column.rb', line 53 def inspect "#<Jackcess::Column name=#{name.inspect} type=#{type.inspect}>" end |
#length ⇒ Object
Get column length
27 28 29 |
# File 'lib/jackcess/column.rb', line 27 def length @java_column.get_length end |
#name ⇒ Object
Get column name
12 13 14 |
# File 'lib/jackcess/column.rb', line 12 def name @java_column.get_name end |
#properties ⇒ Object
Get column properties
42 43 44 45 46 47 48 49 50 51 |
# File 'lib/jackcess/column.rb', line 42 def properties { name: name, type: type, sql_type: sql_type, length: length, auto_number: auto_number?, variable_length: variable_length? } end |
#sql_type ⇒ Object
Get column SQL type
22 23 24 |
# File 'lib/jackcess/column.rb', line 22 def sql_type @java_column.get_sql_type end |
#to_s ⇒ Object
57 58 59 |
# File 'lib/jackcess/column.rb', line 57 def to_s "#{name} (#{type})" end |
#type ⇒ Object
Get column type as Ruby symbol
17 18 19 |
# File 'lib/jackcess/column.rb', line 17 def type TypeConverter.data_type_to_ruby_type(@java_column.get_type) end |
#variable_length? ⇒ Boolean
Check if column is variable length
37 38 39 |
# File 'lib/jackcess/column.rb', line 37 def variable_length? @java_column.is_variable_length end |