Class: NanDoc::PathTardo::Tardo::NotFound
- Inherits:
-
Struct
- Object
- Struct
- NanDoc::PathTardo::Tardo::NotFound
- Defined in:
- lib/nandoc/support/path-tardo.rb
Instance Attribute Summary collapse
-
#hash_or_array ⇒ Object
Returns the value of attribute hash_or_array.
-
#head ⇒ Object
Returns the value of attribute head.
-
#prefix ⇒ Object
Returns the value of attribute prefix.
Instance Method Summary collapse
Instance Attribute Details
#hash_or_array ⇒ Object
Returns the value of attribute hash_or_array
59 60 61 |
# File 'lib/nandoc/support/path-tardo.rb', line 59 def hash_or_array @hash_or_array end |
#head ⇒ Object
Returns the value of attribute head
59 60 61 |
# File 'lib/nandoc/support/path-tardo.rb', line 59 def head @head end |
#prefix ⇒ Object
Returns the value of attribute prefix
59 60 61 |
# File 'lib/nandoc/support/path-tardo.rb', line 59 def prefix @prefix end |
Instance Method Details
#error_message ⇒ Object
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/nandoc/support/path-tardo.rb', line 61 def sub_msg = if idx = PathTardo.tardo_array_index(head) "#{idx} is a nonexistant offset" else "a \"#{head}\" key does not exist" end context_msg = if prefix.empty? nil elsif hash_or_array.kind_of?(Array) "in \"#{prefix}\" array," else "in hash \"#{prefix}\"," end msg = [context_msg, sub_msg].compact.join(' ') msg end |
#found? ⇒ Boolean
60 |
# File 'lib/nandoc/support/path-tardo.rb', line 60 def found?; false end |