Class: I18nFlow::Validator::Error
- Inherits:
-
Object
- Object
- I18nFlow::Validator::Error
- Defined in:
- lib/i18n_flow/validator/errors.rb
Direct Known Subclasses
AsymmetricArgsError, ExtraKeyError, InvalidLocaleError, InvalidTodoError, InvalidTypeError, MissingKeyError, TodoContentError
Instance Attribute Summary collapse
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #data ⇒ Object
-
#initialize(key) ⇒ Error
constructor
A new instance of Error.
- #set_location(node) ⇒ Object
- #single? ⇒ Boolean
Constructor Details
#initialize(key) ⇒ Error
Returns a new instance of Error.
7 8 9 |
# File 'lib/i18n_flow/validator/errors.rb', line 7 def initialize(key) @key = key end |
Instance Attribute Details
#file ⇒ Object (readonly)
Returns the value of attribute file.
4 5 6 |
# File 'lib/i18n_flow/validator/errors.rb', line 4 def file @file end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
3 4 5 |
# File 'lib/i18n_flow/validator/errors.rb', line 3 def key @key end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
5 6 7 |
# File 'lib/i18n_flow/validator/errors.rb', line 5 def line @line end |
Instance Method Details
#==(other) ⇒ Object
11 12 13 14 |
# File 'lib/i18n_flow/validator/errors.rb', line 11 def ==(other) return false unless other.is_a?(self.class) data == other.data end |
#data ⇒ Object
16 17 18 |
# File 'lib/i18n_flow/validator/errors.rb', line 16 def data [key] end |
#set_location(node) ⇒ Object
24 25 26 27 28 |
# File 'lib/i18n_flow/validator/errors.rb', line 24 def set_location(node) @file = node.file_path @line = node.start_line self end |
#single? ⇒ Boolean
20 21 22 |
# File 'lib/i18n_flow/validator/errors.rb', line 20 def single? !!@single end |