Class: Grubby::JsonParser
- Inherits:
-
Mechanize::File
- Object
- Mechanize::File
- Grubby::JsonParser
- Defined in:
- lib/grubby/json_parser.rb
Instance Attribute Summary collapse
-
#json ⇒ Hash, Array
readonly
The parsed JSON data.
-
#mech ⇒ Mechanize?
The Mechanize agent used to make the request.
Instance Method Summary collapse
-
#initialize(uri = nil, response = nil, body = nil, code = nil, mech = nil) ⇒ JsonParser
constructor
A new instance of JsonParser.
Constructor Details
#initialize(uri = nil, response = nil, body = nil, code = nil, mech = nil) ⇒ JsonParser
Returns a new instance of JsonParser.
13 14 15 16 17 |
# File 'lib/grubby/json_parser.rb', line 13 def initialize(uri = nil, response = nil, body = nil, code = nil, mech = nil) @json = JSON.load(body, nil, create_additions: false) @mech = mech super(uri, response, body, code) end |
Instance Attribute Details
#json ⇒ Hash, Array (readonly)
The parsed JSON data.
6 7 8 |
# File 'lib/grubby/json_parser.rb', line 6 def json @json end |
#mech ⇒ Mechanize?
The Mechanize agent used to make the request.
11 12 13 |
# File 'lib/grubby/json_parser.rb', line 11 def mech @mech end |