Class: NanDoc::PathTardo::Tardo::NotFound

Inherits:
Struct
  • Object
show all
Defined in:
lib/nandoc/support/path-tardo.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#hash_or_arrayObject

Returns the value of attribute hash_or_array

Returns:

  • (Object)

    the current value of hash_or_array



59
60
61
# File 'lib/nandoc/support/path-tardo.rb', line 59

def hash_or_array
  @hash_or_array
end

#headObject

Returns the value of attribute head

Returns:

  • (Object)

    the current value of head



59
60
61
# File 'lib/nandoc/support/path-tardo.rb', line 59

def head
  @head
end

#prefixObject

Returns the value of attribute prefix

Returns:

  • (Object)

    the current value of prefix



59
60
61
# File 'lib/nandoc/support/path-tardo.rb', line 59

def prefix
  @prefix
end

Instance Method Details

#error_messageObject



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 error_message
  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

Returns:

  • (Boolean)


60
# File 'lib/nandoc/support/path-tardo.rb', line 60

def found?; false end