Class: Mkxms::Mssql::ScalarTypeHandler

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

Instance Method Summary collapse

Methods included from PropertyHandler::ElementHandler

#handle_property_element

Constructor Details

#initialize(user_types, node) ⇒ ScalarTypeHandler

Returns a new instance of ScalarTypeHandler.



89
90
91
92
93
94
95
# File 'lib/mkxms/mssql/scalar_type_handler.rb', line 89

def initialize(user_types, node)
  a = node.attributes
  ScalarType.new(a).tap do |t|
    store_properties_on t
    user_types << (@type = t)
  end
end

Instance Method Details

#handle_default_element(parse) ⇒ Object



97
98
99
# File 'lib/mkxms/mssql/scalar_type_handler.rb', line 97

def handle_default_element(parse)
  @type.default = Default.new(parse.node.attributes)
end

#handle_text(text, parent_element) ⇒ Object



101
102
103
104
105
106
# File 'lib/mkxms/mssql/scalar_type_handler.rb', line 101

def handle_text(text, parent_element)
  case [parent_element.namespace, parent_element.name]
  when ['', 'default']
    @type.default.definition << text
  end
end