Class: I18nFlow::Validator::TodoContentError

Inherits:
Error
  • Object
show all
Defined in:
lib/i18n_flow/validator/errors.rb

Instance Attribute Summary collapse

Attributes inherited from Error

#file, #key, #line

Instance Method Summary collapse

Methods inherited from Error

#==, #set_location, #single?

Constructor Details

#initialize(key, expect:, actual:, inverse:) ⇒ TodoContentError

Returns a new instance of TodoContentError.



79
80
81
82
83
84
# File 'lib/i18n_flow/validator/errors.rb', line 79

def initialize(key, expect:, actual:, inverse:)
  super(key)
  @expect = expect
  @actual = actual
  @inverse = inverse
end

Instance Attribute Details

#actualObject (readonly)

Returns the value of attribute actual.



74
75
76
# File 'lib/i18n_flow/validator/errors.rb', line 74

def actual
  @actual
end

#dest_nodeObject (readonly)

Returns the value of attribute dest_node.



75
76
77
# File 'lib/i18n_flow/validator/errors.rb', line 75

def dest_node
  @dest_node
end

#expectObject (readonly)

Returns the value of attribute expect.



73
74
75
# File 'lib/i18n_flow/validator/errors.rb', line 73

def expect
  @expect
end

#inverseObject (readonly)

Returns the value of attribute inverse.



77
78
79
# File 'lib/i18n_flow/validator/errors.rb', line 77

def inverse
  @inverse
end

#src_nodeObject (readonly)

Returns the value of attribute src_node.



76
77
78
# File 'lib/i18n_flow/validator/errors.rb', line 76

def src_node
  @src_node
end

Instance Method Details

#dataObject



86
87
88
# File 'lib/i18n_flow/validator/errors.rb', line 86

def data
  super + [expect, actual]
end

#set_correction_context(dest_node:, src_node:) ⇒ Object



90
91
92
93
# File 'lib/i18n_flow/validator/errors.rb', line 90

def set_correction_context(dest_node:, src_node:)
  @dest_node, @src_node = dest_node, src_node
  self
end