Class: Mkxms::Mssql::TableType::ConstraintColumn
- Inherits:
-
Object
- Object
- Mkxms::Mssql::TableType::ConstraintColumn
- Defined in:
- lib/mkxms/mssql/table_type_handler.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #ascending=(val) ⇒ Object
- #ascending? ⇒ Boolean
- #descending=(val) ⇒ Object
- #descending? ⇒ Boolean
-
#initialize(attrs) ⇒ ConstraintColumn
constructor
A new instance of ConstraintColumn.
- #spec ⇒ Object
Constructor Details
#initialize(attrs) ⇒ ConstraintColumn
Returns a new instance of ConstraintColumn.
65 66 67 68 |
# File 'lib/mkxms/mssql/table_type_handler.rb', line 65 def initialize(attrs) @name = attrs['name'] @ascending = !attrs['desc'] end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
70 71 72 |
# File 'lib/mkxms/mssql/table_type_handler.rb', line 70 def name @name end |
Instance Method Details
#ascending=(val) ⇒ Object
74 |
# File 'lib/mkxms/mssql/table_type_handler.rb', line 74 def ascending=(val); @ascending = !!val; end |
#ascending? ⇒ Boolean
72 |
# File 'lib/mkxms/mssql/table_type_handler.rb', line 72 def ascending?; @ascending; end |
#descending=(val) ⇒ Object
75 |
# File 'lib/mkxms/mssql/table_type_handler.rb', line 75 def descending=(val); @ascending = !val; end |
#descending? ⇒ Boolean
73 |
# File 'lib/mkxms/mssql/table_type_handler.rb', line 73 def descending?; !@ascending; end |
#spec ⇒ Object
77 78 79 |
# File 'lib/mkxms/mssql/table_type_handler.rb', line 77 def spec "#{name} #{ascending? ? "ASC" : "DESC"}" end |