Method: HttpParser::Parser::Callback.new
- Defined in:
- lib/http-parser/parser.rb
.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 |