Class: Core::Decorators::Campaign

Inherits:
Draper::Decorator
  • Object
show all
Defined in:
lib/core/decorators/campaign.rb

Instance Method Summary collapse

Instance Method Details

#to_simple_hObject



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/core/decorators/campaign.rb', line 6

def to_simple_h
  {
    id: id.to_s,
    title: title,
    description: description,
    tags: tags,
    players: {
      current: invitations.where(status: :accepted).count,
      max: max_players
    }
  }
end