Class: JsonStructure::FFI::JSError

Inherits:
FFI::Struct
  • Object
show all
Defined in:
lib/jsonstructure/ffi.rb

Instance Method Summary collapse

Instance Method Details

#location_hashObject



75
76
77
78
79
80
81
82
# File 'lib/jsonstructure/ffi.rb', line 75

def location_hash
  loc = self[:location]
  {
    line: loc[:line],
    column: loc[:column],
    offset: loc[:offset]
  }
end

#message_strObject



70
71
72
73
# File 'lib/jsonstructure/ffi.rb', line 70

def message_str
  ptr = self[:message]
  ptr.null? ? '' : ptr.read_string
end

#path_strObject



65
66
67
68
# File 'lib/jsonstructure/ffi.rb', line 65

def path_str
  ptr = self[:path]
  ptr.null? ? nil : ptr.read_string
end