Module: Alchemy::Ingredients::LinkTarget

Included in:
LinkView, PictureView, TextView
Defined in:
app/components/concerns/alchemy/ingredients/link_target.rb

Constant Summary collapse

BLANK_VALUE =
"_blank"
REL_VALUE =
"noopener noreferrer"

Instance Method Summary collapse

Instance Method Details



7
8
9
10
11
# File 'app/components/concerns/alchemy/ingredients/link_target.rb', line 7

def link_rel_value(target)
  if link_target_value(target) == BLANK_VALUE
    REL_VALUE
  end
end


13
14
15
# File 'app/components/concerns/alchemy/ingredients/link_target.rb', line 13

def link_target_value(target)
  (target == "blank") ? BLANK_VALUE : target
end