Class: Tramway::Event::ActionDecorator

Inherits:
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



17
18
19
20
21
22
23
24
25
26
# File 'app/decorators/tramway/event/action_decorator.rb', line 17

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

#nameObject



9
10
11
# File 'app/decorators/tramway/event/action_decorator.rb', line 9

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

#titleObject



13
14
15
# File 'app/decorators/tramway/event/action_decorator.rb', line 13

def title
  object.title
end