Sha256: 1bb7d44d86a2e23ecde14174f2b8ad1827d3e5f1e58632d82e3144db384ded65

Contents?: true

Size: 460 Bytes

Versions: 18

Compression:

Stored size: 460 Bytes

Contents

# frozen_string_literal: true

require "much-rails/mixin"

module MuchRails; end

# MuchRails::CallMethod is a mix-in to implement the `call`
# class/instance method pattern.
module MuchRails::CallMethod
  include MuchRails::Mixin

  mixin_class_methods do
    def call(*args, &block)
      new(*args, &block).call
    end
  end

  mixin_instance_methods do
    def call
      on_call
    end

    def on_call
      raise NotImplementedError
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
much-rails-0.4.3 lib/much-rails/call_method.rb
much-rails-0.4.2 lib/much-rails/call_method.rb
much-rails-0.4.1 lib/much-rails/call_method.rb
much-rails-0.4.0 lib/much-rails/call_method.rb
much-rails-0.3.0 lib/much-rails/call_method.rb
much-rails-0.2.8 lib/much-rails/call_method.rb
much-rails-0.2.7 lib/much-rails/call_method.rb
much-rails-0.2.6 lib/much-rails/call_method.rb
much-rails-0.2.5 lib/much-rails/call_method.rb
much-rails-0.2.4 lib/much-rails/call_method.rb
much-rails-0.2.3 lib/much-rails/call_method.rb
much-rails-0.2.2 lib/much-rails/call_method.rb
much-rails-0.2.1 lib/much-rails/call_method.rb
much-rails-0.2.0 lib/much-rails/call_method.rb
much-rails-0.1.3 lib/much-rails/call_method.rb
much-rails-0.1.2 lib/much-rails/call_method.rb
much-rails-0.1.1 lib/much-rails/call_method.rb
much-rails-0.1.0 lib/much-rails/call_method.rb