Class: HttpParser::Parser::Callback
- Inherits:
-
FFI::Function
- Object
- FFI::Function
- HttpParser::Parser::Callback
- Defined in:
- lib/http-parser/parser.rb
Class Method Summary collapse
-
.new(&block) ⇒ Object
Creates a new Parser callback.
Class Method Details
.new(&block) ⇒ Object
Creates a new Parser callback.
234 235 236 237 238 239 240 241 242 |
# File 'lib/http-parser/parser.rb', line 234 def self.new(&block) super(:int, [::HttpParser::Instance.ptr]) do |parser| begin catch(:return) { yield(parser); 0 } rescue -1 end end end |