Permalink
Browse files

use is_a? rather than respond_to? now that Symbol#[] exists

  • Loading branch information...
1 parent 791202f commit 735462f30b688fa7b0d6ec63be93c0d844b27fa3 @vito committed May 7, 2012
Showing with 2 additions and 2 deletions.
  1. +1 −1 lib/atomy/ast/node.rb
  2. +1 −1 lib/atomy/patterns.rb
@@ -28,7 +28,7 @@ def self.extended(sub)
def spec(into, specs)
specs.each do |s|
- if s.respond_to?(:[]) and s.respond_to?(:size)
+ if s.is_a?(Array)
name = s[0]
if s.size == 2
into[:optional] << s
@@ -27,7 +27,7 @@ def self.extended(sub)
def spec(into, specs)
specs.each do |s|
- if s.respond_to?(:[]) and s.respond_to?(:size)
+ if s.is_a?(Array)
name = s[0]
if s.size == 2
into[:optional] << s

0 comments on commit 735462f

Please sign in to comment.