Class: BetterHtml::TestHelper::SafeErb::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/better_html/test_helper/safe_erb/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parser, config: BetterHtml.config) ⇒ Base

Returns a new instance of Base.



14
15
16
17
18
# File 'lib/better_html/test_helper/safe_erb/base.rb', line 14

def initialize(parser, config: BetterHtml.config)
  @parser = parser
  @config = config
  @errors = BetterHtml::Errors.new
end

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.



12
13
14
# File 'lib/better_html/test_helper/safe_erb/base.rb', line 12

def errors
  @errors
end

Instance Method Details

#add_error(message, location:) ⇒ Object



20
21
22
# File 'lib/better_html/test_helper/safe_erb/base.rb', line 20

def add_error(message, location:)
  @errors.add(SafetyError.new(message, location: location))
end