Sha256: 21af0fb8c401b2c061f5786553b39d590ec305574fc05e36395b334fe805da49
Contents?: true
Size: 970 Bytes
Versions: 21
Compression:
Stored size: 970 Bytes
Contents
require "expressir/express_exp/formatter" module Expressir module ExpressExp class HyperlinkFormatter < Formatter def format_expressions_simple_reference(node) return node.id if node.parent.is_a? Model::Expressions::AttributeReference # skip hyperlink if target node can't be found target_node = node.find(node.id) return node.id unless target_node # skip hyperlink for implicit scopes return node.id if target_node.is_a? Model::Statements::Alias or target_node.is_a? Model::Statements::Repeat or target_node.is_a? Model::Expressions::QueryExpression # skip hyperlink if this node and target node are in the same main item node_path_parts = node.path.split(".") target_node_path_parts = target_node.path.split(".") return node.id if node_path_parts[0..1] == target_node_path_parts[0..1] "{{{<<express:#{target_node.path},#{node.id}>>}}}" end end end end
Version data entries
21 entries across 21 versions & 1 rubygems