Sha256: 87b981439b9c90a8909ccc57b7c92cea62974fea5de7c81f15e74fd6be1c7b6e

Contents?: true

Size: 707 Bytes

Versions: 121

Compression:

Stored size: 707 Bytes

Contents

module Tins
  module AskAndSend
    def ask_and_send(method_name, *args, &block)
      if respond_to?(method_name)
        __send__(method_name, *args, &block)
      end
    end

    def ask_and_send!(method_name, *args, &block)
      if respond_to?(method_name, true)
        __send__(method_name, *args, &block)
      end
    end

    def ask_and_send_or_self(method_name, *args, &block)
      if respond_to?(method_name)
        __send__(method_name, *args, &block)
      else
        self
      end
    end

    def ask_and_send_or_self!(method_name, *args, &block)
      if respond_to?(method_name, true)
        __send__(method_name, *args, &block)
      else
        self
      end
    end
  end
end

Version data entries

121 entries across 107 versions & 8 rubygems

Version Path
tdiary-5.0.9 vendor/bundle/gems/tins-1.16.3/lib/tins/ask_and_send.rb
tdiary-5.0.8 vendor/bundle/gems/tdiary-5.0.7/vendor/bundle/gems/tins-1.16.3/lib/tins/ask_and_send.rb
tdiary-5.0.7 vendor/bundle/gems/tins-1.16.3/lib/tins/ask_and_send.rb
tins-1.16.3 lib/tins/ask_and_send.rb
tins-1.16.2 lib/tins/ask_and_send.rb
tins-1.16.1 lib/tins/ask_and_send.rb
tins-1.16.0 lib/tins/ask_and_send.rb
tins-1.15.1 lib/tins/ask_and_send.rb
tdiary-5.0.6 vendor/bundle/gems/tins-1.15.0/lib/tins/ask_and_send.rb
logstash-filter-cache-redis-0.3.1 vendor/bundle/jruby/1.9/gems/tins-1.6.0/lib/tins/ask_and_send.rb
logstash-filter-cache-redis-0.3.0 vendor/bundle/jruby/1.9/gems/tins-1.6.0/lib/tins/ask_and_send.rb
logstash-filter-cache-redis-0.2.0 vendor/bundle/jruby/1.9/gems/tins-1.6.0/lib/tins/ask_and_send.rb
logstash-filter-cache-redis-0.1.0 vendor/bundle/jruby/1.9/gems/tins-1.6.0/lib/tins/ask_and_send.rb
tins-1.15.0 lib/tins/ask_and_send.rb
tdiary-5.0.5 vendor/bundle/gems/tins-1.14.0/lib/tins/ask_and_send.rb
tdiary-5.0.5 vendor/bundle/gems/tdiary-5.0.4/vendor/bundle/gems/tins-1.13.2/lib/tins/ask_and_send.rb
tdiary-5.0.5 vendor/bundle/gems/tins-1.13.2/lib/tins/ask_and_send.rb
tins-1.14.0 lib/tins/ask_and_send.rb
tins-1.13.3 lib/tins/ask_and_send.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/tins-1.13.2/lib/tins/ask_and_send.rb