Sha256: 4868060e1bbf6063a69d9910aca0cbe00967eed5724ae6e6947d8ce33f1e2bfb

Contents?: true

Size: 344 Bytes

Versions: 34

Compression:

Stored size: 344 Bytes

Contents

# encoding: utf-8

# Array
class Array
  # alias of map {|v|send :some_kernel_method, v}
  #
  # === Example
  #
  #   [*1..3].kernel_send:Rational # => [(1/1), (2/1), (3/1)]
  #
  def kernel_send(method_name)
    return self unless [Symbol, String].include? method_name.class
    map { |v|send method_name.to_sym, v }
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
tbpgr_utils-0.0.150 lib/open_classes/array/kernel_send.rb
tbpgr_utils-0.0.149 lib/open_classes/array/kernel_send.rb
tbpgr_utils-0.0.148 lib/open_classes/array/kernel_send.rb
tbpgr_utils-0.0.147 lib/open_classes/array/kernel_send.rb
tbpgr_utils-0.0.146 lib/open_classes/array/kernel_send.rb
tbpgr_utils-0.0.145 lib/open_classes/array/kernel_send.rb
tbpgr_utils-0.0.144 lib/open_classes/array/kernel_send.rb
tbpgr_utils-0.0.143 lib/open_classes/array/kernel_send.rb
tbpgr_utils-0.0.142 lib/open_classes/array/kernel_send.rb
tbpgr_utils-0.0.141 lib/open_classes/array/kernel_send.rb
tbpgr_utils-0.0.140 lib/open_classes/array/kernel_send.rb
tbpgr_utils-0.0.139 lib/open_classes/array/kernel_send.rb
tbpgr_utils-0.0.138 lib/open_classes/array/kernel_send.rb
tbpgr_utils-0.0.137 lib/open_classes/array/kernel_send.rb
tbpgr_utils-0.0.136 lib/open_classes/array/kernel_send.rb
tbpgr_utils-0.0.135 lib/open_classes/array/kernel_send.rb
tbpgr_utils-0.0.134 lib/open_classes/array/kernel_send.rb
tbpgr_utils-0.0.133 lib/open_classes/array/kernel_send.rb
tbpgr_utils-0.0.132 lib/open_classes/array/kernel_send.rb
tbpgr_utils-0.0.131 lib/open_classes/array/kernel_send.rb