File: json.rb

package info (click to toggle)
ruby-postmark 1.25.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 480 kB
  • sloc: ruby: 5,413; makefile: 4
file content (22 lines) | stat: -rw-r--r-- 323 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
module Postmark
  module Json

    class << self
      def encode(data)
        json_parser
        data.to_json
      end

      def decode(data)
        json_parser.decode(data)
      end

      private

      def json_parser
        ResponseParsers.const_get(Postmark.response_parser_class)
      end

    end
  end
end