Class: Appfuel::WebApi::Repository

Inherits:
Repository::Base show all
Defined in:
lib/appfuel/storage/web_api/repository.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Repository::Base

#apply_query_conditions, #build, #build_criteria, #build_default_entity, #build_domains, cache, create_mapper, #create_settings, #criteria?, #execute_query_method, #exists?, #find_entity_builder, #generate_uuid, inherited, #mapper, #query, #query_setup, #timestamp, #to_storage, #url_token

Methods included from Application::AppContainer

#app_container, #feature_name, included, #qualify_container_key

Instance Attribute Details

#response_handlerObject (readonly)

Returns the value of attribute response_handler.



10
11
12
# File 'lib/appfuel/storage/web_api/repository.rb', line 10

def response_handler
  @response_handler
end

Class Method Details

.container_class_typeObject



5
6
7
# File 'lib/appfuel/storage/web_api/repository.rb', line 5

def container_class_type
  "#{super}.web_api"
end

Instance Method Details

#create(entity, exclude = []) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/appfuel/storage/web_api/repository.rb', line 12

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

#storage_class(domain_name) ⇒ Object



25
26
27
# File 'lib/appfuel/storage/web_api/repository.rb', line 25

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

#to_entity(domain_name, storage) ⇒ Object



29
30
31
# File 'lib/appfuel/storage/web_api/repository.rb', line 29

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