Class: Ffprober::Parsers::Json

Inherits:
Object
  • Object
show all
Defined in:
lib/ffprober/parsers/json.rb

Instance Method Summary collapse

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

#jsonObject



9
10
11
# File 'lib/ffprober/parsers/json.rb', line 9

def json
  @json ||= JSON.parse(@json_to_parse, symbolize_names: true)
end