Class: Eventable::Categorylist::CategoryItem
- Inherits:
-
Object
- Object
- Eventable::Categorylist::CategoryItem
- Defined in:
- app/models/eventable/categorylist.rb
Instance Attribute Summary collapse
-
#active ⇒ Object
Returns the value of attribute active.
-
#event ⇒ Object
readonly
Returns the value of attribute event.
-
#group ⇒ Object
readonly
Returns the value of attribute group.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(event, category) ⇒ CategoryItem
constructor
A new instance of CategoryItem.
- #new_record? ⇒ Boolean
Constructor Details
#initialize(event, category) ⇒ CategoryItem
Returns a new instance of CategoryItem.
10 11 12 13 14 15 16 |
# File 'app/models/eventable/categorylist.rb', line 10 def initialize(event, category) @event = event @name = category.name @group = category.group @id = category.id @active = event.category_ids.include? @id end |
Instance Attribute Details
#active ⇒ Object
Returns the value of attribute active.
8 9 10 |
# File 'app/models/eventable/categorylist.rb', line 8 def active @active end |
#event ⇒ Object (readonly)
Returns the value of attribute event.
7 8 9 |
# File 'app/models/eventable/categorylist.rb', line 7 def event @event end |
#group ⇒ Object (readonly)
Returns the value of attribute group.
7 8 9 |
# File 'app/models/eventable/categorylist.rb', line 7 def group @group end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
7 8 9 |
# File 'app/models/eventable/categorylist.rb', line 7 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'app/models/eventable/categorylist.rb', line 7 def name @name end |
Instance Method Details
#new_record? ⇒ Boolean
18 19 20 |
# File 'app/models/eventable/categorylist.rb', line 18 def new_record? true end |