Module: ROM::Github

Defined in:
lib/rom/github.rb,
lib/rom/github/types.rb,
lib/rom/github/schema.rb,
lib/rom/github/uri_helper.rb,
lib/rom/github/resources/base.rb,
lib/rom/github/resources/repositories.rb,
lib/rom/github/associations/one_to_one.rb,
lib/rom/github/resources/pull_requests.rb,
lib/rom/github/associations/one_to_many.rb,
lib/rom/github/mappers/pull_request_mapper.rb

Defined Under Namespace

Modules: Associations, Mappers, Resources, Types, UriHelper Classes: Error, Schema

Class Method Summary collapse

Class Method Details

.create_container(*args, **opts) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/rom/github.rb', line 25

def self.create_container(*args, **opts)
  config = if args.first.is_a?(ROM::Configuration)
             args.first
           else
             options = { uri: 'https://api.github.com', handlers: :json }
             options = Transproc::HashTransformations[:deep_merge].call(options, opts)
             ROM::Configuration.new(:http, options)
           end

  config.register_relation(
    ROM::Github::Resources::Repositories,
    ROM::Github::Resources::PullRequests
  )

  config.register_mapper(ROM::Github::Mappers::PullRequestMapper)

  ROM.container(config)
end