Module: Lutaml::XMI::Parsers::XMIBase

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



12
13
14
# File 'lib/lutaml/xmi/parsers/xmi_base.rb', line 12

def self.included(base)
  base.extend(ClassMethods)
end

Instance Method Details

#get_guidance(yaml) ⇒ Hash

Parameters:

  • yaml (String)

Returns:

  • (Hash)


35
36
37
38
39
# File 'lib/lutaml/xmi/parsers/xmi_base.rb', line 35

def get_guidance(yaml)
  return unless yaml

  YAML.safe_load(File.read(yaml, encoding: "UTF-8"))
end

#set_xmi_model(xmi_model) ⇒ Object

Parameters:

  • xmi_model (Lutaml::Model::Serializable)


27
28
29
30
31
# File 'lib/lutaml/xmi/parsers/xmi_base.rb', line 27

def set_xmi_model(xmi_model)
  @xmi_cache = {}
  @xmi_root_model = xmi_model
  map_id_name(@xmi_cache, @xmi_root_model)
end