Sha256: acd07f82295cbe649e66094a09bf9607bc4af7f855bdd98a988c4e784126153f

Contents?: true

Size: 505 Bytes

Versions: 5

Compression:

Stored size: 505 Bytes

Contents

# frozen_string_literal: true

module AppStoreDevApi
  class Request
    class Body
      def self.inherited(klass)
        super

        klass.include(Object::Included)
        klass.include(Object::Data)
      end

      def initialize(**kwargs)
        @included = self.class::Included.new([*kwargs.delete(:included)])
        @data = self.class::Data.new(**kwargs)
      end

      def to_h
        {
          data: data.to_h,
          included: included.to_a
        }
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
app_store_dev_api-0.1.4 lib/app_store_dev_api/request/body.rb
app_store_dev_api-0.1.3 lib/app_store_dev_api/request/body.rb
app_store_dev_api-0.1.2 lib/app_store_dev_api/request/body.rb
app_store_dev_api-0.1.1 lib/app_store_dev_api/request/body.rb
app_store_dev_api-0.1.0 lib/app_store_dev_api/request/body.rb