Class: Mkxms::Mssql::Default
- Inherits:
-
Object
- Object
- Mkxms::Mssql::Default
- Includes:
- Utils::SchemaQualifiedName
- Defined in:
- lib/mkxms/mssql/scalar_type_handler.rb
Instance Attribute Summary collapse
-
#definition ⇒ Object
readonly
Returns the value of attribute definition.
-
#name ⇒ Object
Returns the value of attribute name.
-
#schema ⇒ Object
Returns the value of attribute schema.
Instance Method Summary collapse
-
#initialize(attrs) ⇒ Default
constructor
A new instance of Default.
- #to_sql ⇒ Object
Methods included from Utils::SchemaQualifiedName
Constructor Details
#initialize(attrs) ⇒ Default
Returns a new instance of Default.
71 72 73 74 75 76 |
# File 'lib/mkxms/mssql/scalar_type_handler.rb', line 71 def initialize(attrs) a = attrs @schema = a['schema'] @name = a['name'] @definition = "" end |
Instance Attribute Details
#definition ⇒ Object (readonly)
Returns the value of attribute definition.
79 80 81 |
# File 'lib/mkxms/mssql/scalar_type_handler.rb', line 79 def definition @definition end |
#name ⇒ Object
Returns the value of attribute name.
78 79 80 |
# File 'lib/mkxms/mssql/scalar_type_handler.rb', line 78 def name @name end |
#schema ⇒ Object
Returns the value of attribute schema.
78 79 80 |
# File 'lib/mkxms/mssql/scalar_type_handler.rb', line 78 def schema @schema end |
Instance Method Details
#to_sql ⇒ Object
81 82 83 |
# File 'lib/mkxms/mssql/scalar_type_handler.rb', line 81 def to_sql "CREATE DEFAULT #{qualified_name} AS #{definition};" end |