Class: BetterHtml::Config

Inherits:
Object
  • Object
show all
Includes:
SmartProperties
Defined in:
lib/better_html/config.rb

Instance Method Summary collapse

Instance Method Details

#javascript_attribute_name?(name) ⇒ Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/better_html/config.rb', line 20

def javascript_attribute_name?(name)
  javascript_attribute_names.any? { |other| other === name.to_s } # rubocop:disable Style/CaseEquality
end

#javascript_safe_method?(name) ⇒ Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/better_html/config.rb', line 28

def javascript_safe_method?(name)
  javascript_safe_methods.include?(name.to_s)
end

#lodash_safe_javascript_expression?(code) ⇒ Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/better_html/config.rb', line 24

def lodash_safe_javascript_expression?(code)
  lodash_safe_javascript_expression.any? { |other| other === code } # rubocop:disable Style/CaseEquality
end