Module: Feroxbuster::Parsers::JSON
- Defined in:
- lib/feroxbuster/parsers/json.rb
Overview
Parses single-line JSON hashes.
Class Method Summary collapse
-
.parse(io) {|data| ... } ⇒ Enumerator
Parses a single-line of JSON.
Class Method Details
.parse(io) {|data| ... } ⇒ Enumerator
Parses a single-line of JSON.
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/feroxbuster/parsers/json.rb', line 29 def self.parse(io) return enum_for(__method__,io) unless block_given? io.each_line do |line| line.chomp! json = ::JSON.parse(line) case json["type"] when "response" yield map_response(json) when "statistics" yield map_statistics(json) else raise(NotImplementedError,"unsupported JSON type: #{json['type']}") end end end |