Class: Xmi::EaRoot
Overview
rubocop:disable Metrics/ClassLength
Constant Summary collapse
- MODULE_TEMPLATE =
<<~TEXT module Xmi class EaRoot module #MODULE_NAME# #KLASSES# end end end TEXT
- KLASS_TEMPLATE =
<<~TEXT class #KLASS_NAME# < #FROM_KLASS# #ROOT_TAG_LINE# #ATTRIBUTES##XML_MAPPING# end TEXT
- XML_MAPPING =
<<~TEXT xml do root "#ROOT_TAG#" #MAP_ATTRIBUTES# end TEXT
- ATTRIBUTE_LINE =
<<~TEXT attribute :#TAG_NAME#, #ATTRIBUTE_TYPE# TEXT
- MAP_ATTRIBUTES =
<<~TEXT map_attribute "#ATTRIBUTE_NAME#", to: :#ATTRIBUTE_METHOD# TEXT
- MAP_ELEMENT =
<<~TEXT map_element "#ELEMENT_NAME#", to: :#ELEMENT_METHOD#, namespace: "#NAMESPACE#", prefix: "#PREFIX#" TEXT
Class Method Summary collapse
- .load_extension(options) ⇒ Object
- .load_mdg_extension(xml_path) ⇒ Object
- .output_rb_file(output_rb_path) ⇒ Object
Class Method Details
.load_extension(options) ⇒ Object
56 57 58 59 |
# File 'lib/xmi/ea_root.rb', line 56 def load_extension() @content = gen_content() Object.class_eval @content end |
.load_mdg_extension(xml_path) ⇒ Object
48 49 50 51 52 53 54 |
# File 'lib/xmi/ea_root.rb', line 48 def load_mdg_extension(xml_path) = {} [:input_xml_path] = xml_path [:module_name] = "Mdg" load_extension() update_mdg_mappings end |
.output_rb_file(output_rb_path) ⇒ Object
61 62 63 |
# File 'lib/xmi/ea_root.rb', line 61 def output_rb_file(output_rb_path) File.open(output_rb_path, "w") { |file| file.write(@content) } end |