Class: Wallaby::LinkOptionsNormalizer

Inherits:
Object
  • Object
show all
Defined in:
lib/services/wallaby/link_options_normalizer.rb

Overview

Link renderer

Class Method Summary collapse

Class Method Details

.normalize(html_options, block, defaults) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'lib/services/wallaby/link_options_normalizer.rb', line 5

def normalize(html_options, block, defaults)
  block ||= defaults[:block]
  html_options[:title] ||= defaults[:block].call
  # allow empty class to be set
  if !html_options.key?(:class) && defaults[:class]
    html_options[:class] = defaults[:class]
  end
  [html_options, block]
end