Sha256: 03cd749706f0e9c5510a3eed938ff13b317a07c7711d620b73a582768bbc7a1c

Contents?: true

Size: 620 Bytes

Versions: 14

Compression:

Stored size: 620 Bytes

Contents

class Card
  module Set
    module Helpers
      def shortname
        parts = name.split "::"
        first = 2 # shortname eliminates Card::Set
        pattern_name = parts[first].underscore
        last = if pattern_name == "abstract"
                 first + 1
               else
                 set_class = Pattern.find pattern_name
                 first + set_class.anchor_parts_count
               end
        parts[first..last].join "::"
      end

      def abstract_set?
        name =~ /^Card::Set::Abstract::/
      end

      def all_set?
        name =~ /^Card::Set::All::/
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
card-1.91 lib/card/set/helpers.rb
card-1.21.0 lib/card/set/helpers.rb
card-1.20.4 lib/card/set/helpers.rb
card-1.20.3 lib/card/set/helpers.rb
card-1.20.2 lib/card/set/helpers.rb
card-1.20.1 lib/card/set/helpers.rb
card-1.20.0 lib/card/set/helpers.rb
card-1.19.6 lib/card/set/helpers.rb
card-1.19.5 lib/card/set/helpers.rb
card-1.19.4 lib/card/set/helpers.rb
card-1.19.3 lib/card/set/helpers.rb
card-1.19.2 lib/card/set/helpers.rb
card-1.19.1 lib/card/set/helpers.rb
card-1.19.0 lib/card/set/helpers.rb