Class: Nero::FormatTag
Instance Method Summary collapse
Instance Method Details
#resolve(args, context:) ⇒ Object
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/nero/format_tag.rb', line 5 def resolve(args, context:) template = args[0] opts = args.each_with_object({}) do |arg, h| h.merge!(arg.transform_keys(&:to_sym)) if arg.is_a?(Hash) end format(template, opts) rescue KeyError => e context.add_error("format error: #{e.}") nil end |