Sha256: 7c348b8a6c93e9974b1f5aed6e364768ade5e444a170d4e560c2863118cd64ad

Contents?: true

Size: 414 Bytes

Versions: 1

Compression:

Stored size: 414 Bytes

Contents

# frozen_string_literal: true

class Polist::Service::Middleware
  def initialize(service)
    @service = service
  end

  # Should be implemented in subclasses
  def call; end

  private

  attr_reader :service

  %i[fail! error! success! form form_attributes].each do |service_method|
    define_method(service_method) do |*args, **options|
      service.send(service_method, *args, **options)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
polist-1.4.0 lib/polist/service/middleware.rb