Class: CanTango::Configuration::Categories::Category
- Inherits:
-
Object
- Object
- CanTango::Configuration::Categories::Category
- Defined in:
- lib/cantango/configuration/categories.rb
Instance Method Summary collapse
-
#has_any?(subject, &block) ⇒ Boolean
test if a particular category has a certain subject.
-
#initialize(*subjects) ⇒ Category
constructor
A new instance of Category.
- #subjects ⇒ Object
Constructor Details
#initialize(*subjects) ⇒ Category
Returns a new instance of Category.
40 41 42 |
# File 'lib/cantango/configuration/categories.rb', line 40 def initialize *subjects @subjects = subjects.flatten end |
Instance Method Details
#has_any?(subject, &block) ⇒ Boolean
test if a particular category has a certain subject
49 50 51 52 53 |
# File 'lib/cantango/configuration/categories.rb', line 49 def has_any? subject, &block found = subjects.include? subject yield if found && block found end |
#subjects ⇒ Object
44 45 46 |
# File 'lib/cantango/configuration/categories.rb', line 44 def subjects @subjects ||= [] end |