Skip to content
Browse files

意味が曖昧だったので has_ をつけた

  • Loading branch information...
1 parent cdadfe0 commit f2e144d6b96de2e5c2b186c927ccdadd0d0afc5a @mashiro committed Apr 11, 2012
Showing with 6 additions and 6 deletions.
  1. +1 −1 lib/rlyeh/dispatcher.rb
  2. +2 −2 lib/rlyeh/environment.rb
  3. +3 −3 spec/rlyeh/environment_spec.rb
View
2 lib/rlyeh/dispatcher.rb
@@ -36,7 +36,7 @@ def on(*args, &block)
end
def dispatch(env)
- if env.event?
+ if env.has_event?
target = env.event
trigger target, env
end
View
4 lib/rlyeh/environment.rb
@@ -7,15 +7,15 @@ def respond_to?(method_id, include_private = false)
def respond_to_missing?(method_id, include_private)
method_name = method_id.to_s
return true if method_name =~ /^(.+)=$/
- return true if method_name =~ /^(.+)\?$/
+ return true if method_name =~ /^has_(.+)\?$/
return true if self.key? method_name
super
end
def method_missing(method_id, *args, &block)
method_name = method_id.to_s
return self[$1] = args.first if method_name =~ /^(.+)=$/
- return self.key? $1 if method_name =~ /^(.+)\?$/
+ return self.has_key? $1 if method_name =~ /^has_(.+)\?$/
return self[method_name] if self.key? method_name
super
end
View
6 spec/rlyeh/environment_spec.rb
@@ -34,9 +34,9 @@
end
context 'has' do
- it { should be_foo }
- it { should be_bar }
- it { should_not be_buzz }
+ it { should be_has_foo }
+ it { should be_has_bar }
+ it { should_not be_has_buzz }
end
end
end

0 comments on commit f2e144d

Please sign in to comment.
Something went wrong with that request. Please try again.