Sha256: 62f85a33c5b1269fd5478302726d8a297d55bcf2b09876832603900ce8c1a1c2

Contents?: true

Size: 401 Bytes

Versions: 8

Compression:

Stored size: 401 Bytes

Contents

module CanTango
  class Configuration
    class Category
      def initialize *subjects
        @subjects = subjects.flatten
      end

      def subjects
        @subjects ||= []
      end

      # test if a particular category has a certain subject
      def has_any? subject, &block
        found = subjects.include? subject
        yield if found && block
        found
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
cantango-config-0.1.9.2 lib/cantango/configuration/category.rb
cantango-config-0.1.8.1 lib/cantango/configuration/category.rb
cantango-config-0.1.8 lib/cantango/configuration/category.rb
cantango-config-0.1.7 lib/cantango/configuration/category.rb
cantango-config-0.1.6 lib/cantango/configuration/category.rb
cantango-config-0.1.5 lib/cantango/configuration/category.rb
cantango-config-0.1.4 lib/cantango/configuration/category.rb
cantango-config-0.1.3 lib/cantango/configuration/category.rb