Sha256: 89817d12abaeec379517790a18111964c3d0804ba62374fb7f794bf209da7ef7

Contents?: true

Size: 547 Bytes

Versions: 67

Compression:

Stored size: 547 Bytes

Contents

# frozen_string_literal: true
require 'dato/json_api_serializer'
require 'dato/json_api_deserializer'

module Dato
  module Account
    module Repo
      class Base
        attr_reader :client

        def initialize(client)
          @client = client
        end

        private

        %i(post put delete get).each do |method|
          define_method "#{method}_request" do |*args|
            JsonApiDeserializer.new.deserialize(
              client.request(method, *args)
            )
          end
        end
      end
    end
  end
end

Version data entries

67 entries across 67 versions & 1 rubygems

Version Path
dato-0.2.6 lib/dato/account/repo/base.rb
dato-0.2.4 lib/dato/account/repo/base.rb
dato-0.1.31 lib/dato/account/repo/base.rb
dato-0.1.30 lib/dato/account/repo/base.rb
dato-0.1.29 lib/dato/account/repo/base.rb
dato-0.1.28 lib/dato/account/repo/base.rb
dato-0.1.27 lib/dato/account/repo/base.rb
dato-0.1.26 lib/dato/account/repo/base.rb
dato-0.1.25 lib/dato/account/repo/base.rb
dato-0.1.24 lib/dato/account/repo/base.rb
dato-0.1.23 lib/dato/account/repo/base.rb
dato-0.1.22 lib/dato/account/repo/base.rb
dato-0.1.21 lib/dato/account/repo/base.rb
dato-0.1.20 lib/dato/account/repo/base.rb
dato-0.1.19 lib/dato/account/repo/base.rb
dato-0.1.18 lib/dato/account/repo/base.rb
dato-0.1.17 lib/dato/account/repo/base.rb
dato-0.1.16 lib/dato/account/repo/base.rb
dato-0.1.15 lib/dato/account/repo/base.rb
dato-0.1.14 lib/dato/account/repo/base.rb