Sha256: aa72a942e9160195a317108d075eeb27f97a65b604ae3a2722b5ac2e343f3598

Contents?: true

Size: 406 Bytes

Versions: 77

Compression:

Stored size: 406 Bytes

Contents

class Symbol
  # Turns the symbol into a simple proc, which is especially useful for enumerations. Examples:
  #
  #   # The same as people.collect { |p| p.name }
  #   people.collect(&:name)
  #
  #   # The same as people.select { |p| p.manager? }.collect { |p| p.salary }
  #   people.select(&:manager?).collect(&:salary)
  def to_proc
    Proc.new { |*args| args.shift.__send__(self, *args) }
  end
end

Version data entries

77 entries across 77 versions & 6 rubygems

Version Path
jstorimer-deep-test-2.0.0 sample_rails_project/vendor/rails/activesupport/lib/active_support/core_ext/symbol.rb
jstorimer-deep-test-1.4.0 sample_rails_project/vendor/rails/activesupport/lib/active_support/core_ext/symbol.rb
jstorimer-deep-test-1.3.0 sample_rails_project/vendor/rails/activesupport/lib/active_support/core_ext/symbol.rb
jstorimer-deep-test-1.2.0 sample_rails_project/vendor/rails/activesupport/lib/active_support/core_ext/symbol.rb
jstorimer-deep-test-1.1.0 sample_rails_project/vendor/rails/activesupport/lib/active_support/core_ext/symbol.rb
jstorimer-deep-test-1.0.0 sample_rails_project/vendor/rails/activesupport/lib/active_support/core_ext/symbol.rb
jstorimer-deep-test-0.2.0 sample_rails_project/vendor/rails/activesupport/lib/active_support/core_ext/symbol.rb
jstorimer-deep-test-0.1.0 sample_rails_project/vendor/rails/activesupport/lib/active_support/core_ext/symbol.rb
activesupport-1.4.1 lib/active_support/core_ext/symbol.rb
activesupport-1.4.2 lib/active_support/core_ext/symbol.rb
activesupport-1.4.3 lib/active_support/core_ext/symbol.rb
activesupport-1.4.4 lib/active_support/core_ext/symbol.rb
activesupport-1.4.0 lib/active_support/core_ext/symbol.rb
backlog-0.0.0 vendor/rails/activesupport/lib/active_support/core_ext/symbol.rb
backlog-0.0.1 vendor/rails/activesupport/lib/active_support/core_ext/symbol.rb
backlog-0.0.2 vendor/rails/activesupport/lib/active_support/core_ext/symbol.rb
backlog-0.0.5 vendor/rails/activesupport/lib/active_support/core_ext/symbol.rb
backlog-0.0.4 vendor/rails/activesupport/lib/active_support/core_ext/symbol.rb
backlog-0.1.0 vendor/rails/activesupport/lib/active_support/core_ext/symbol.rb
backlog-0.1.1 vendor/rails/activesupport/lib/active_support/core_ext/symbol.rb