Class: Mkxms::Mssql::FunctionHandler

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

Instance Method Summary collapse

Methods included from PropertyHandler::ElementHandler

#handle_property_element

Constructor Details

#initialize(functions, node) ⇒ FunctionHandler

Returns a new instance of FunctionHandler.



44
45
46
47
48
49
50
51
# File 'lib/mkxms/mssql/function_handler.rb', line 44

def initialize(functions, node)
  a = node.attributes
  
  @function = Function.new(a).tap do |f|
    store_properties_on f
    functions << f
  end
end

Instance Method Details

#handle_definition_element(parse) ⇒ Object



53
# File 'lib/mkxms/mssql/function_handler.rb', line 53

def handle_definition_element(parse); end

#handle_param_property(parse) ⇒ Object



59
# File 'lib/mkxms/mssql/function_handler.rb', line 59

def handle_param_property(parse); end

#handle_references_element(parse) ⇒ Object



55
56
57
# File 'lib/mkxms/mssql/function_handler.rb', line 55

def handle_references_element(parse)
  @function.references << %w[schema name].map {|k| parse.node.attributes[k]}.join('.')
end

#handle_text(text, parent_element) ⇒ Object



61
62
63
64
65
66
67
68
69
# File 'lib/mkxms/mssql/function_handler.rb', line 61

def handle_text(text, parent_element)
  case [parent_element.namespace, parent_element.name]
  when ['', 'definition']
    @function.definition << text
  when ['', 'param-property']
    a = parent_element.attributes
    @function.param_properties[[a['param'], a['property']]] << text
  end
end