Module: Rpush::MultiJsonHelper
- Included in:
- Client::ActiveRecord::Notification, Client::Redis::Notification, Daemon::Adm::Delivery, Daemon::Fcm::Delivery, Daemon::Pushy::Delivery
- Defined in:
- lib/rpush/multi_json_helper.rb
Instance Method Summary collapse
Instance Method Details
#multi_json_dump(string, options = {}) ⇒ Object
12 13 14 |
# File 'lib/rpush/multi_json_helper.rb', line 12 def multi_json_dump(string, = {}) MultiJson.respond_to?(:dump) ? MultiJson.dump(string, ) : MultiJson.encode(string, ) end |
#multi_json_load(string, options = {}) ⇒ Object
3 4 5 6 7 8 9 10 |
# File 'lib/rpush/multi_json_helper.rb', line 3 def multi_json_load(string, = {}) # Calling load on multi_json less than v1.3.0 attempts to load a file from disk. if Gem.loaded_specs['multi_json'].version >= Gem::Version.create('1.3.0') MultiJson.load(string, ) else MultiJson.decode(string, ) end end |