Class: Keboola::GoodDataWriter::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/keboola/gooddata_writer/parser.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.parse(string) ⇒ Object


7
8
9
10
11
12
13
# File 'lib/keboola/gooddata_writer/parser.rb', line 7

def self.parse(string)
  begin
    JSON.parse(string)
  rescue JSON::ParserError, TypeError => e
    raise ParsingError.new(e.message)
  end
end

Instance Method Details

#parse(string) ⇒ Object


15
16
17
# File 'lib/keboola/gooddata_writer/parser.rb', line 15

def parse(string)
  self.class.parse(string)
end