Class: OffTheGridTrucks::DetailedEvent

Inherits:
Event
  • Object
show all
Defined in:
lib/off_the_grid_trucks/detailed_event.rb

Instance Attribute Summary collapse

Attributes inherited from Event

#assigned_vendors, #end_time, #id, #is_featured, #location_id, #location_name, #name, #number_of_assigned_vendors, #start_time

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ DetailedEvent

Returns a new instance of DetailedEvent.



12
13
14
15
16
17
18
19
20
21
# File 'lib/off_the_grid_trucks/detailed_event.rb', line 12

def initialize(args)
  super(args)

  @meal_type = args.fetch('mealType') {}
  @location = Location.new(args.fetch('location') {})
  @location_details = args.fetch('locationDetails') {}
  @services = args.fetch('services') {}.map { |service| Service.new(service) }
  @community_activations = args.fetch('communityActivations') {}
  @entertainments = args.fetch('entertainments') {}
end

Instance Attribute Details

#community_activationsObject (readonly)

Returns the value of attribute community_activations.



9
10
11
# File 'lib/off_the_grid_trucks/detailed_event.rb', line 9

def community_activations
  @community_activations
end

#entertainmentsObject (readonly)

Returns the value of attribute entertainments.



9
10
11
# File 'lib/off_the_grid_trucks/detailed_event.rb', line 9

def entertainments
  @entertainments
end

#locationObject (readonly)

Returns the value of attribute location.



9
10
11
# File 'lib/off_the_grid_trucks/detailed_event.rb', line 9

def location
  @location
end

#location_detailsObject (readonly)

Returns the value of attribute location_details.



9
10
11
# File 'lib/off_the_grid_trucks/detailed_event.rb', line 9

def location_details
  @location_details
end

#meal_typeObject (readonly)

Returns the value of attribute meal_type.



9
10
11
# File 'lib/off_the_grid_trucks/detailed_event.rb', line 9

def meal_type
  @meal_type
end

#servicesObject (readonly)

Returns the value of attribute services.



9
10
11
# File 'lib/off_the_grid_trucks/detailed_event.rb', line 9

def services
  @services
end

Class Method Details

.allObject



24
# File 'lib/off_the_grid_trucks/detailed_event.rb', line 24

def all; end

.get(id) ⇒ Object



26
27
28
# File 'lib/off_the_grid_trucks/detailed_event.rb', line 26

def get(id)
  new(Request.get(resource: 'events', id: id)['event'])
end