Sha256: b02cd08c5a1f6fe2e110b11f2b6d85d07269d9316c0e4e0f46ab6e0d479bfe41

Contents?: true

Size: 345 Bytes

Versions: 2

Compression:

Stored size: 345 Bytes

Contents

module CanTango
  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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cantango-config-0.2.1 lib/cantango/category.rb
cantango-config-0.2.0 lib/cantango/category.rb