Class: ShowSerializer

Inherits:
ActiveModel::Serializer
  • Object
show all
Defined in:
app/serializers/show_serializer.rb

Instance Method Summary collapse

Instance Method Details

#eventObject



8
9
10
# File 'app/serializers/show_serializer.rb', line 8

def event
  EventSerializer.new(object.event, @options)
end

#include_event?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'app/serializers/show_serializer.rb', line 12

def include_event?
  @options[:event]
end

#tickets_soldObject



4
5
6
# File 'app/serializers/show_serializer.rb', line 4

def tickets_sold
  object.sold || 0
end