Class: Tramway::Event::ActionDecorator

Inherits:
Core::ApplicationDecorator
  • Object
show all
Defined in:
app/decorators/tramway/event/action_decorator.rb

Instance Method Summary collapse

Instance Method Details

#action_state_button_color(event) ⇒ Object



11
12
13
14
15
16
17
18
19
20
# File 'app/decorators/tramway/event/action_decorator.rb', line 11

def action_state_button_color(event)
  case event
  when :do
    :success
  when :decline
    :danger
  when :return
    :warning
  end
end

#nameObject



7
8
9
# File 'app/decorators/tramway/event/action_decorator.rb', line 7

def name
  "#{object.title} - #{date_view(object.deadline)} - #{state_machine_view(object, :action_state)}"
end