Class: FFI::Clang::CodeCompletion::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/ffi/clang/code_completion.rb

Overview

Represents a single code completion result.

Instance Method Summary collapse

Constructor Details

#initialize(result) ⇒ Result

Initialize a completion result.



139
140
141
# File 'lib/ffi/clang/code_completion.rb', line 139

def initialize(result)
  @result = result
end

Instance Method Details

#inspectObject

Get a string representation of this result.



157
158
159
# File 'lib/ffi/clang/code_completion.rb', line 157

def inspect
  "<#{kind.inspect} = #{string.inspect}>"
end

#kindObject

Get the kind of completion.



145
146
147
# File 'lib/ffi/clang/code_completion.rb', line 145

def kind
  @result[:kind]
end

#stringObject

Get the completion string.



151
152
153
# File 'lib/ffi/clang/code_completion.rb', line 151

def string
  CodeCompletion::String.new @result[:string]
end