Repository URL to install this package:
|
Version:
0.13.0.0 ▾
|
module EventSource
module EventData
class Hash < ::Hash
module Transformer
def self.json
JSON
end
def self.instance(raw_data)
Hash[raw_data]
end
def self.raw_data(instance)
Hash[instance]
end
module JSON
def self.write(raw_hash_data)
json_formatted_data = Casing::Camel.(raw_hash_data)
::JSON.generate(json_formatted_data)
end
def self.read(text)
json_formatted_data = ::JSON.parse(text, :symbolize_names => true)
Casing::Underscore.(json_formatted_data)
end
end
end
end
end
end