Class: Mkxms::Mssql::FilegroupHandler

Inherits:
Object
  • Object
show all
Includes:
PropertyHandler::ElementHandler
Defined in:
lib/mkxms/mssql/filegroup_handler.rb

Instance Method Summary collapse

Methods included from PropertyHandler::ElementHandler

#handle_property_element

Constructor Details

#initialize(filegroups, node) ⇒ FilegroupHandler

Returns a new instance of FilegroupHandler.



27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/mkxms/mssql/filegroup_handler.rb', line 27

def initialize(filegroups, node)
  group_options = Hash[
    %w[default read-only].map do |a|
      [Utils.code_sym_for(a), node.attributes.has_key?(a)]
    end
  ]
  @filegroup = Filegroup.new(**group_options).tap do |fg|
    store_properties_on fg
    filegroups << fg
  end
  @files = []
end

Instance Method Details

#handle_file_element(parse) ⇒ Object



40
41
42
# File 'lib/mkxms/mssql/filegroup_handler.rb', line 40

def handle_file_element(parse)
  parse.context = DatabaseFile.new(@files, parse.node)
end