Class: Eventable::Categorylist::CategoryItem

Inherits:
Object
  • Object
show all
Defined in:
app/models/eventable/categorylist.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#activeObject

Returns the value of attribute active.



8
9
10
# File 'app/models/eventable/categorylist.rb', line 8

def active
  @active
end

#eventObject (readonly)

Returns the value of attribute event.



7
8
9
# File 'app/models/eventable/categorylist.rb', line 7

def event
  @event
end

#groupObject (readonly)

Returns the value of attribute group.



7
8
9
# File 'app/models/eventable/categorylist.rb', line 7

def group
  @group
end

#idObject (readonly)

Returns the value of attribute id.



7
8
9
# File 'app/models/eventable/categorylist.rb', line 7

def id
  @id
end

#nameObject (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

Returns:

  • (Boolean)


18
19
20
# File 'app/models/eventable/categorylist.rb', line 18

def new_record?
  true
end