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.



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

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.



10
11
12
# File 'lib/better_html/test_helper/safe_erb/base.rb', line 10

def errors
  @errors
end

Instance Method Details

#add_error(message, location:) ⇒ Object



18
19
20
# File 'lib/better_html/test_helper/safe_erb/base.rb', line 18

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