Module: RubyLokaliseApi::JsonHandler

Included in:
Request
Defined in:
lib/ruby_lokalise_api/json_handler.rb

Overview

JSON custom parser. Uses built-in JSON by default but can be overridden to any other parser

Instance Method Summary collapse

Instance Method Details

#custom_dump(obj) ⇒ Object

Converts Ruby object to JSON



9
10
11
# File 'lib/ruby_lokalise_api/json_handler.rb', line 9

def custom_dump(obj)
  JSON.dump obj
end

#custom_load(obj) ⇒ Object

Converts JSON to Ruby object



14
15
16
# File 'lib/ruby_lokalise_api/json_handler.rb', line 14

def custom_load(obj)
  JSON.parse obj
end