Class: Ffprober::Parsers::JsonParser
- Inherits:
-
Object
- Object
- Ffprober::Parsers::JsonParser
- Defined in:
- lib/ffprober/parsers/json.rb
Instance Method Summary collapse
-
#initialize(json_to_parse) ⇒ JsonParser
constructor
A new instance of JsonParser.
- #json ⇒ Object
Constructor Details
#initialize(json_to_parse) ⇒ JsonParser
Returns a new instance of JsonParser.
7 8 9 10 11 |
# File 'lib/ffprober/parsers/json.rb', line 7 def initialize(json_to_parse) raise ArgumentError, 'No JSON input data' if json_to_parse.nil? @json_to_parse = json_to_parse end |
Instance Method Details
#json ⇒ Object
13 14 15 |
# File 'lib/ffprober/parsers/json.rb', line 13 def json @json ||= JSON.parse(@json_to_parse, symbolize_names: true) end |