Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Refactor: reduce number of to_sym calls. #2009

Merged
merged 1 commit into from
Jun 23, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/rspec/core/example.rb
Original file line number Diff line number Diff line change
Expand Up @@ -262,13 +262,15 @@ class Procsy
attr_reader :example

Example.public_instance_methods(false).each do |name|
next if name.to_sym == :run || name.to_sym == :inspect || name.to_sym == :to_s
name_sym = name.to_sym
next if name_sym == :run || name_sym == :inspect || name_sym == :to_s

define_method(name) { |*a, &b| @example.__send__(name, *a, &b) }
end

Proc.public_instance_methods(false).each do |name|
next if name.to_sym == :call || name.to_sym == :inspect || name.to_sym == :to_s || name.to_sym == :to_proc
name_sym = name.to_sym
next if name_sym == :call || name_sym == :inspect || name_sym == :to_s || name_sym == :to_proc

define_method(name) { |*a, &b| @proc.__send__(name, *a, &b) }
end
Expand Down