Class: SvgConform::ValidationNotice
- Inherits:
-
Object
- Object
- SvgConform::ValidationNotice
- Defined in:
- lib/svg_conform/validation_context.rb
Overview
New class for non-error notifications
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#node ⇒ Object
readonly
Returns the value of attribute node.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #column ⇒ Object
-
#initialize(type:, node:, message:, data: {}) ⇒ ValidationNotice
constructor
A new instance of ValidationNotice.
- #line ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize(type:, node:, message:, data: {}) ⇒ ValidationNotice
Returns a new instance of ValidationNotice.
533 534 535 536 537 538 |
# File 'lib/svg_conform/validation_context.rb', line 533 def initialize(type:, node:, message:, data: {}) @type = type @node = node = @data = data end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
531 532 533 |
# File 'lib/svg_conform/validation_context.rb', line 531 def data @data end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
531 532 533 |
# File 'lib/svg_conform/validation_context.rb', line 531 def end |
#node ⇒ Object (readonly)
Returns the value of attribute node.
531 532 533 |
# File 'lib/svg_conform/validation_context.rb', line 531 def node @node end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
531 532 533 |
# File 'lib/svg_conform/validation_context.rb', line 531 def type @type end |
Instance Method Details
#column ⇒ Object
544 545 546 |
# File 'lib/svg_conform/validation_context.rb', line 544 def column @node.respond_to?(:column) ? @node.column : nil end |
#line ⇒ Object
540 541 542 |
# File 'lib/svg_conform/validation_context.rb', line 540 def line @node.respond_to?(:line) ? @node.line : nil end |
#to_h ⇒ Object
548 549 550 551 552 553 554 555 556 |
# File 'lib/svg_conform/validation_context.rb', line 548 def to_h { type: @type, message: , line: line, column: column, data: @data, } end |