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