Module: EventPresenter::InstanceMethods

Defined in:
app/presenters/event_presenter.rb

Instance Method Summary collapse

Instance Method Details

#as_full_calendar_jsonObject



21
22
23
24
25
26
27
28
29
30
# File 'app/presenters/event_presenter.rb', line 21

def as_full_calendar_json
  shows.collect do |p|
    { :title  => '',
      :start  => p.datetime_local_to_event,
      :allDay => false,
      :color  => '#077083',
      :id     => p.id
    }
  end
end

#as_json(options = {}) ⇒ Object



32
33
34
# File 'app/presenters/event_presenter.rb', line 32

def as_json(options = {})
  super(options)
end

#as_widget_json(options = {}) ⇒ Object

JSON Methods



17
18
19
# File 'app/presenters/event_presenter.rb', line 17

def as_widget_json(options = {})
  as_json(options.merge(:methods => ['shows', 'charts', 'venue'])).merge('performances' => upcoming_public_shows.as_json)
end

#to_sObject



12
13
14
# File 'app/presenters/event_presenter.rb', line 12

def to_s
  self.name || ""
end