Class: Nero::RefTag

Inherits:
BaseTag show all
Defined in:
lib/nero/ref_tag.rb

Overview

!ref a.c (preferred) or the sequence form !ref [a, c] (as in Nero < 0.7). Segments are split on ".", so !ref [a.b, c] is a.b.c.

Instance Method Summary collapse

Instance Method Details

#resolve(args, context:) ⇒ Object



7
8
9
10
11
12
# File 'lib/nero/ref_tag.rb', line 7

def resolve(args, context:)
  ref_path = args.flat_map { _1.to_s.split(".") }
  context.deprecate "!ref [#{args.join(", ")}] is deprecated", use: "!ref #{ref_path.join(".")}", removed_in: "0.8" if args.size > 1

  Ref.new(ref_path)
end