Class: Metanorma::Plugin::Lutaml::ExpressRemarksDecorator

Inherits:
Object
  • Object
show all
Defined in:
lib/metanorma/plugin/lutaml/express_remarks_decorator.rb

Constant Summary collapse

RELATIVE_PREFIX_MACRO_REGEXP =
/^(link|image|video|audio|include)(:+)?(?![^\/:]+:\/\/|[A-Z]:\/|\/)([^:\[]+)(\[.*\])?$/.freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(remark, options) ⇒ ExpressRemarksDecorator

Returns a new instance of ExpressRemarksDecorator.



15
16
17
18
# File 'lib/metanorma/plugin/lutaml/express_remarks_decorator.rb', line 15

def initialize(remark, options)
  @remark = remark
  @options = options
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



9
10
11
# File 'lib/metanorma/plugin/lutaml/express_remarks_decorator.rb', line 9

def options
  @options
end

#remarkObject (readonly)

Returns the value of attribute remark.



9
10
11
# File 'lib/metanorma/plugin/lutaml/express_remarks_decorator.rb', line 9

def remark
  @remark
end

Class Method Details

.call(remark, options) ⇒ Object



11
12
13
# File 'lib/metanorma/plugin/lutaml/express_remarks_decorator.rb', line 11

def self.call(remark, options)
  new(remark, options).call
end

Instance Method Details

#callObject



20
21
22
23
24
25
26
27
# File 'lib/metanorma/plugin/lutaml/express_remarks_decorator.rb', line 20

def call
  result = remark
  if options["relative_path_prefix"]
    result = update_relative_paths(result,
                                  options["relative_path_prefix"])
  end
  result
end