Class: Stepmod::Utils::Concept

Inherits:
Object
  • Object
show all
Defined in:
lib/stepmod/utils/concept.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Concept

Returns a new instance of Concept.



17
18
19
20
21
# File 'lib/stepmod/utils/concept.rb', line 17

def initialize(options)
  options.each_pair do |k, v|
    send("#{k}=", v)
  end
end

Class Method Details

.parse(definition_xml, reference_anchor:, reference_clause:, file_path:) ⇒ Object



23
24
25
26
27
28
29
30
# File 'lib/stepmod/utils/concept.rb', line 23

def self.parse(definition_xml, reference_anchor:, reference_clause:, file_path:)
  new(
    converted_definition: Stepmod::Utils::StepmodDefinitionConverter.convert(definition_xml),
    reference_anchor: reference_anchor,
    reference_clause: reference_clause,
    file_path: file_path
  )
end

Instance Method Details

#to_mn_adoc ⇒ Object



32
33
34
35
36
37
38
39
40
41
# File 'lib/stepmod/utils/concept.rb', line 32

def to_mn_adoc
  <<~TEXT
    // STEPmod path: #{file_path}
    #{converted_definition}

    [.source]
    <<#{reference_anchor},clause=#{reference_clause}>>

  TEXT
end