Sha256: ae8d7c56d148c51995af9abf7fa31e3e58e7dd906dfd32154a983f0675d194c6

Contents?: true

Size: 1.09 KB

Versions: 33

Compression:

Stored size: 1.09 KB

Contents

module Appfuel
  module WebApi
    class Repository < Appfuel::Repository::Base
      class << self
        def container_class_type
          "#{super}.web_api"
        end
      end

      attr_reader :response_handler

      def create(entity, exclude = [])
=begin
        data = to_storage(entity, exclude: ['id'])
        results = []
        data.each do |api_class_key, mapped|
          api_model = api_class(api_class_key)
          results << api_model.create(mapped)
        end

        build(name: entity.domain_name, storage: db_results, type: :web_api)
=end
      end

      def storage_class(domain_name)
        mapper.storage_class(:web_api, domain_name)
      end

      def to_entity(domain_name, storage)
        super(domain_name, :web_api, storage)
      end

      private

      def raise_error(err, message)
        error = RuntimeError.new(message)
        error.set_backtrace(err.backtrace)
        raise error
      end

      def validate_entity_id(entity)
        if entity.id == Types::Undefined
          fail("entity id is #{entity.id}")
        end
      end
    end
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
appfuel-0.7.0 lib/appfuel/storage/web_api/repository.rb
appfuel-0.6.16 lib/appfuel/storage/web_api/repository.rb
appfuel-0.6.15 lib/appfuel/storage/web_api/repository.rb
appfuel-0.6.14 lib/appfuel/storage/web_api/repository.rb
appfuel-0.6.13 lib/appfuel/storage/web_api/repository.rb
appfuel-0.6.12 lib/appfuel/storage/web_api/repository.rb
appfuel-0.6.11 lib/appfuel/storage/web_api/repository.rb
appfuel-0.6.10 lib/appfuel/storage/web_api/repository.rb
appfuel-0.6.9 lib/appfuel/storage/web_api/repository.rb
appfuel-0.6.8 lib/appfuel/storage/web_api/repository.rb
appfuel-0.6.7 lib/appfuel/storage/web_api/repository.rb
appfuel-0.6.6 lib/appfuel/storage/web_api/repository.rb
appfuel-0.6.5 lib/appfuel/storage/web_api/repository.rb
appfuel-0.6.4 lib/appfuel/storage/web_api/repository.rb
appfuel-0.6.3 lib/appfuel/storage/web_api/repository.rb
appfuel-0.6.1 lib/appfuel/storage/web_api/repository.rb
appfuel-0.5.16 lib/appfuel/storage/web_api/repository.rb
appfuel-0.5.15 lib/appfuel/storage/web_api/repository.rb
appfuel-0.5.14 lib/appfuel/storage/web_api/repository.rb
appfuel-0.5.13 lib/appfuel/storage/web_api/repository.rb