Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
Size: Mime:
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