Sha256: 4509e37df4dcf1c1e7b6b4d14b986f8f8a4f735559dfbf714d721b4c8ae451e6

Contents?: true

Size: 544 Bytes

Versions: 67

Compression:

Stored size: 544 Bytes

Contents

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

module Dato
  module Site
    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.5.1 lib/dato/site/repo/base.rb
dato-0.5.0 lib/dato/site/repo/base.rb
dato-0.4.3 lib/dato/site/repo/base.rb
dato-0.4.2 lib/dato/site/repo/base.rb
dato-0.4.1 lib/dato/site/repo/base.rb
dato-0.4.0 lib/dato/site/repo/base.rb
dato-0.3.31 lib/dato/site/repo/base.rb
dato-0.4.0.pre lib/dato/site/repo/base.rb
dato-0.3.30 lib/dato/site/repo/base.rb
dato-0.3.29 lib/dato/site/repo/base.rb
dato-0.3.28 lib/dato/site/repo/base.rb
dato-0.3.27 lib/dato/site/repo/base.rb
dato-0.3.26 lib/dato/site/repo/base.rb
dato-0.3.25 lib/dato/site/repo/base.rb
dato-0.3.24 lib/dato/site/repo/base.rb
dato-0.3.23 lib/dato/site/repo/base.rb
dato-0.3.22 lib/dato/site/repo/base.rb
dato-0.3.21 lib/dato/site/repo/base.rb
dato-0.3.20 lib/dato/site/repo/base.rb
dato-0.3.19 lib/dato/site/repo/base.rb