Sha256: 574e8503fffa0bc76332fffe1eae57dec30c86b1995857d8d833432dc4c5b630

Contents?: true

Size: 593 Bytes

Versions: 7

Compression:

Stored size: 593 Bytes

Contents

# frozen_string_literal: true

require 'roda'
require 'zeitwerk'

loader = Zeitwerk::Loader.for_gem
loader.setup

module PicoApi
  def self.root_path
    File.dirname(__dir__)
  end

  def self.lib_path
    File.join(root_path, 'lib/pico_api')
  end

  class Application < Roda
    parser = proc { |data| JSON.parse(data, symbolize_names: true) }

    plugin :symbol_status
    plugin :json_parser, parser: parser
    plugin :json, content_type: 'application/vnd.api+json'
    plugin :error_handler do |e|
      PicoApi::Handlers::Errors.call(e, response)
    end
  end
end

loader.eager_load

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
pico_api-0.1.0 lib/pico_api.rb
pico_api-0.0.6 lib/pico_api.rb
pico_api-0.0.5 lib/pico_api.rb
pico_api-0.0.4 lib/pico_api.rb
pico_api-0.0.3 lib/pico_api.rb
pico_api-0.0.2 lib/pico_api.rb
pico_api-0.0.1 lib/pico_api.rb