Class: Mkxms::Mssql::View

Inherits:
Object
  • Object
show all
Includes:
ExtendedProperties, Property::Hosting, Property::SchemaScoped, Utils::SchemaQualifiedName
Defined in:
lib/mkxms/mssql/view_handler.rb

Constant Summary collapse

SQL_OBJECT_TYPE =
'VIEW'

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Utils::SchemaQualifiedName

#qualified_name

Methods included from ExtendedProperties

#extended_properties

Methods included from Property::Hosting

#extended_properties_sql

Methods included from Property::SchemaScoped

#property_subject_identifiers, #subitem_extended_properties_sql

Constructor Details

#initialize(attrs) ⇒ View

Returns a new instance of View.



14
15
16
17
18
19
# File 'lib/mkxms/mssql/view_handler.rb', line 14

def initialize(attrs)
  @schema = attrs['schema']
  @name = attrs['name']
  @definition = ''
  @references = []
end

Instance Attribute Details

#definitionObject (readonly)

Returns the value of attribute definition.



22
23
24
# File 'lib/mkxms/mssql/view_handler.rb', line 22

def definition
  @definition
end

#nameObject

Returns the value of attribute name.



21
22
23
# File 'lib/mkxms/mssql/view_handler.rb', line 21

def name
  @name
end

#referencesObject (readonly)

Returns the value of attribute references.



22
23
24
# File 'lib/mkxms/mssql/view_handler.rb', line 22

def references
  @references
end

#schemaObject

Returns the value of attribute schema.



21
22
23
# File 'lib/mkxms/mssql/view_handler.rb', line 21

def schema
  @schema
end

Instance Method Details

#to_sqlObject



24
25
26
27
# File 'lib/mkxms/mssql/view_handler.rb', line 24

def to_sql
  mvdef = AccessObjectDefinition.replace_object_name(definition, "[{filename}]")
  ([mvdef] + extended_properties_sql).join("\n")
end