Class: Mkxms::Mssql::StoredProcedure
- Inherits:
-
Object
- Object
- Mkxms::Mssql::StoredProcedure
- Defined in:
- lib/mkxms/mssql/stored_procedure_handler.rb
Constant Summary collapse
- SQL_OBJECT_TYPE =
'PROCEDURE'
Instance Attribute Summary collapse
-
#definition ⇒ Object
readonly
Returns the value of attribute definition.
-
#name ⇒ Object
Returns the value of attribute name.
-
#param_properties ⇒ Object
readonly
Returns the value of attribute param_properties.
-
#schema ⇒ Object
Returns the value of attribute schema.
Instance Method Summary collapse
-
#initialize(attrs) ⇒ StoredProcedure
constructor
A new instance of StoredProcedure.
- #param_properties_sql ⇒ Object
- #to_sql ⇒ Object
Methods included from Utils::SchemaQualifiedName
Methods included from ExtendedProperties
Methods included from Property::Hosting
Methods included from Property::SchemaScoped
#property_subject_identifiers, #subitem_extended_properties_sql
Constructor Details
#initialize(attrs) ⇒ StoredProcedure
Returns a new instance of StoredProcedure.
12 13 14 15 16 17 |
# File 'lib/mkxms/mssql/stored_procedure_handler.rb', line 12 def initialize(attrs) @schema = attrs['schema'] @name = attrs['name'] @definition = '' @param_properties = Hash.new {|h, k| h[k] = ''} end |
Instance Attribute Details
#definition ⇒ Object (readonly)
Returns the value of attribute definition.
20 21 22 |
# File 'lib/mkxms/mssql/stored_procedure_handler.rb', line 20 def definition @definition end |
#name ⇒ Object
Returns the value of attribute name.
19 20 21 |
# File 'lib/mkxms/mssql/stored_procedure_handler.rb', line 19 def name @name end |
#param_properties ⇒ Object (readonly)
Returns the value of attribute param_properties.
20 21 22 |
# File 'lib/mkxms/mssql/stored_procedure_handler.rb', line 20 def param_properties @param_properties end |
#schema ⇒ Object
Returns the value of attribute schema.
19 20 21 |
# File 'lib/mkxms/mssql/stored_procedure_handler.rb', line 19 def schema @schema end |
Instance Method Details
#param_properties_sql ⇒ Object
27 28 29 30 31 |
# File 'lib/mkxms/mssql/stored_procedure_handler.rb', line 27 def param_properties_sql @param_properties.each_pair.map do |k, v| Property.addition_sql(k[1], v, property_subject_identifiers + ['PARAMETER', Utils.unquoted_name(k[0])]) end end |
#to_sql ⇒ Object
22 23 24 25 |
# File 'lib/mkxms/mssql/stored_procedure_handler.rb', line 22 def to_sql mvdef = AccessObjectDefinition.replace_object_name(definition, "[{filename}]") ([mvdef] + extended_properties_sql + param_properties_sql).join("\n") end |