Module: Yes::Read::Api

Defined in:
lib/yes/read/api.rb,
lib/yes/read/api/engine.rb,
lib/yes/read/api/version.rb,
lib/yes/read/api/model_constraints.rb,
lib/yes/read/api/api_pagination_patch.rb,
lib/yes/read/api/advanced_filter_validator.rb,
app/controllers/yes/read/api/queries_controller.rb,
app/controllers/yes/read/api/application_controller.rb

Defined Under Namespace

Modules: ApiPaginationPatch Classes: AdvancedFilterValidator, ApplicationController, Engine, Error, ModelConstraints, QueriesController

Constant Summary collapse

VERSION =
'1.1.0'

Class Method Summary collapse

Class Method Details

.configActiveSupport::OrderedOptions

Returns:

  • (ActiveSupport::OrderedOptions)


24
25
26
27
28
# File 'lib/yes/read/api.rb', line 24

def config
  @config ||= ActiveSupport::OrderedOptions.new.tap do |opts|
    opts.read_models = [] # E.g. ['apprenticeships', 'companies', 'professions']
  end
end

.configure {|config| ... } ⇒ Object

Yields:



30
31
32
# File 'lib/yes/read/api.rb', line 30

def configure
  yield config
end

.loaderObject



12
13
14
15
16
17
18
19
20
21
# File 'lib/yes/read/api.rb', line 12

def loader
  @loader ||= begin
    loader = Zeitwerk::Loader.new
    loader.tag = 'yes-read-api'
    loader.push_dir(File.expand_path('../..', __dir__))
    loader.ignore("#{File.expand_path('..', __dir__)}/read/api/version.rb")
    loader.setup
    loader
  end
end