lib/card/set/inheritance.rb in card-1.107.0 vs lib/card/set/inheritance.rb in card-1.108.0

- old
+ new

@@ -47,11 +47,11 @@ # @option opts [Symbol, Array<Symbol>] :except don't include these formats # @example # include_set_formats Type::Basic, except: :css def include_set_formats set, opts={} each_format set do |format, format_mods| - format_sym = Card::Format.format_sym format + format_sym = format.to_sym next unless applicable_format?(format_sym, opts[:except], opts[:only]) format_mods.each do |format_mod| define_on_format format_sym do include format_mod @@ -75,11 +75,10 @@ set_type = set.abstract_set? ? :abstract : :nonbase format_type = "#{set_type}_format".to_sym Set.modules[format_type].each_pair { |*args| yield(*args) } end - def applicable_format? format, except, only - format_sym = Card::Format.format_sym format + def applicable_format? format_sym, except, only return false if except && Array(except).include?(format_sym) return false if only && !Array(only).include?(format_sym) true end