Class: FFI_Yajl::Parser
- Includes:
- Ext::Parser, FFI::Parser
- Defined in:
- lib/ffi_yajl/ext.rb,
lib/ffi_yajl/ffi.rb,
lib/ffi_yajl/parser.rb
Instance Attribute Summary collapse
-
#opts ⇒ Object
Returns the value of attribute opts.
Attributes included from FFI::Parser
#finished, #key, #key_stack, #stack
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Parser
constructor
A new instance of Parser.
- #parse(str) ⇒ Object
Methods included from FFI::Parser
#do_yajl_parse, #key_pop, #key_push, #set_value, #setup_callbacks, #stack_pop
Methods included from Ext::Parser
Constructor Details
#initialize(opts = {}) ⇒ Parser
Returns a new instance of Parser.
11 12 13 |
# File 'lib/ffi_yajl/parser.rb', line 11 def initialize(opts = {}) @opts = opts end |
Instance Attribute Details
#opts ⇒ Object
Returns the value of attribute opts.
5 6 7 |
# File 'lib/ffi_yajl/parser.rb', line 5 def opts @opts end |
Class Method Details
.parse(obj, *args) ⇒ Object
7 8 9 |
# File 'lib/ffi_yajl/parser.rb', line 7 def self.parse(obj, *args) new(*args).parse(obj) end |
Instance Method Details
#parse(str) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/ffi_yajl/parser.rb', line 15 def parse(str) # initialization that we can do in pure ruby yajl_opts = {} # call either the ext or ffi hook do_yajl_parse(str, yajl_opts) end |