Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

another quick pattern patch

  • Loading branch information...
commit ee2c020e45f5e052e075248d27dd05415b8b5623 1 parent 9506943
@ethn ethn authored
Showing with 7 additions and 2 deletions.
  1. +7 −2 lib/cardlib/pattern.rb
View
9 lib/cardlib/pattern.rb
@@ -170,7 +170,7 @@ def set_const
def get_method_key
if self.class.anchorless?
self.class.method_key
- elsif self.class.opt_keys.size == opt_vals.size
+ else
opts = {}
self.class.opt_keys.each_with_index do |key, index|
return nil unless opt_vals[index]
@@ -188,7 +188,12 @@ def opt_vals
end
def find_opt_vals
- @anchor_name.parts.map do |part|
+ anchor_parts = if self.class.opt_keys.size > 1
+ [ @anchor_name.left, @anchor_name.right ]
+ else
+ [ @anchor_name ]
+ end
+ anchor_parts.map do |part|
card = Card.fetch part, :skip_virtual=>true, :skip_modules=>true
card && Wagn::Codename[card.id.to_i] or return []
end
Please sign in to comment.
Something went wrong with that request. Please try again.