Class: Edrive::Handler

Inherits:
Object
  • Object
show all
Defined in:
lib/edrive/handler.rb

Overview

event handlers sample

Class Method Summary collapse

Class Method Details

.hash2jsonProc

hash to json

Returns:

  • (Proc)

    proc hash to json



11
12
13
# File 'lib/edrive/handler.rb', line 11

def hash2json
  ->(hash) { Oj.dump(hash, :compat) }
end

.json2hashJSON

json to hash

Returns:

  • (JSON)

    proc json to hash



17
18
19
# File 'lib/edrive/handler.rb', line 17

def json2hash
  ->(json) { Oj.load(json) }
end