Class: ActiveRecordSpannerAdapter::Index::Column
- Inherits:
-
Object
- Object
- ActiveRecordSpannerAdapter::Index::Column
- Defined in:
- lib/activerecord_spanner_adapter/index/column.rb
Instance Attribute Summary collapse
-
#index_name ⇒ Object
Returns the value of attribute index_name.
-
#name ⇒ Object
Returns the value of attribute name.
-
#order ⇒ Object
Returns the value of attribute order.
-
#ordinal_position ⇒ Object
Returns the value of attribute ordinal_position.
-
#schema_name ⇒ Object
Returns the value of attribute schema_name.
-
#table_name ⇒ Object
Returns the value of attribute table_name.
Instance Method Summary collapse
- #desc! ⇒ Object
- #desc? ⇒ Boolean
-
#initialize(table_name, index_name, name, schema_name: "", order: nil, ordinal_position: nil) ⇒ Column
constructor
A new instance of Column.
- #storing? ⇒ Boolean
Constructor Details
#initialize(table_name, index_name, name, schema_name: "", order: nil, ordinal_position: nil) ⇒ Column
Returns a new instance of Column.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/activerecord_spanner_adapter/index/column.rb', line 12 def initialize \ table_name, index_name, name, schema_name: "", order: nil, ordinal_position: nil @table_name = table_name.to_s @index_name = index_name.to_s @schema_name = schema_name.to_s @name = name.to_s @order = order.to_s.upcase if order @ordinal_position = ordinal_position end |
Instance Attribute Details
#index_name ⇒ Object
Returns the value of attribute index_name.
10 11 12 |
# File 'lib/activerecord_spanner_adapter/index/column.rb', line 10 def index_name @index_name end |
#name ⇒ Object
Returns the value of attribute name.
10 11 12 |
# File 'lib/activerecord_spanner_adapter/index/column.rb', line 10 def name @name end |
#order ⇒ Object
Returns the value of attribute order.
10 11 12 |
# File 'lib/activerecord_spanner_adapter/index/column.rb', line 10 def order @order end |
#ordinal_position ⇒ Object
Returns the value of attribute ordinal_position.
10 11 12 |
# File 'lib/activerecord_spanner_adapter/index/column.rb', line 10 def ordinal_position @ordinal_position end |
#schema_name ⇒ Object
Returns the value of attribute schema_name.
10 11 12 |
# File 'lib/activerecord_spanner_adapter/index/column.rb', line 10 def schema_name @schema_name end |
#table_name ⇒ Object
Returns the value of attribute table_name.
10 11 12 |
# File 'lib/activerecord_spanner_adapter/index/column.rb', line 10 def table_name @table_name end |
Instance Method Details
#desc! ⇒ Object
35 36 37 |
# File 'lib/activerecord_spanner_adapter/index/column.rb', line 35 def desc! @order = "DESC" end |
#desc? ⇒ Boolean
31 32 33 |
# File 'lib/activerecord_spanner_adapter/index/column.rb', line 31 def desc? @order == "DESC" end |
#storing? ⇒ Boolean
27 28 29 |
# File 'lib/activerecord_spanner_adapter/index/column.rb', line 27 def storing? @ordinal_position.nil? end |