Class: Seatsio::Chart

Inherits:
Object
  • Object
show all
Defined in:
lib/seatsio/domain.rb

Direct Known Subclasses

ChartDraft

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Chart

Returns a new instance of Chart.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/seatsio/domain.rb', line 13

def initialize(data)
  @id = data['id']
  @key = data['key']
  @status = data['status']
  @name = data['name']
  @published_version_thumbnail_url = data['publishedVersionThumbnailUrl']
  @draft_version_thumbnail_url = data['draftVersionThumbnailUrl']
  @events = Event.create_list(data['events']) if data['events']
  @tags = data['tags']
  @archived = data['archived']
  @validation = data['validation']
  @social_distancing_rulesets = data['socialDistancingRulesets'].map {
      |key, r| [key, SocialDistancingRuleset.new(r['name'],
                                                 number_of_disabled_seats_to_the_sides: r['numberOfDisabledSeatsToTheSides'],
                                                 disable_seats_in_front_and_behind: r['disableSeatsInFrontAndBehind'],
                                                 disable_diagonal_seats_in_front_and_behind: r['disableDiagonalSeatsInFrontAndBehind'],
                                                 number_of_disabled_aisle_seats: r['numberOfDisabledAisleSeats'],
                                                 max_group_size: r['maxGroupSize'],
                                                 max_occupancy_absolute: r['maxOccupancyAbsolute'],
                                                 max_occupancy_percentage: r['maxOccupancyPercentage'],
                                                 one_group_per_table: r['oneGroupPerTable'],
                                                 fixed_group_layout: r['fixedGroupLayout'],
                                                 disabled_seats: r['disabledSeats'],
                                                 enabled_seats: r['enabledSeats'],
                                                 index: r['index'])]
  }.to_h
end

Instance Attribute Details

#archivedObject (readonly)

Returns the value of attribute archived.



9
10
11
# File 'lib/seatsio/domain.rb', line 9

def archived
  @archived
end

#categoriesObject (readonly)

Returns the value of attribute categories.



9
10
11
# File 'lib/seatsio/domain.rb', line 9

def categories
  @categories
end

#draft_version_thumbnail_urlObject (readonly)

Returns the value of attribute draft_version_thumbnail_url.



9
10
11
# File 'lib/seatsio/domain.rb', line 9

def draft_version_thumbnail_url
  @draft_version_thumbnail_url
end

#eventsObject (readonly)

Returns the value of attribute events.



9
10
11
# File 'lib/seatsio/domain.rb', line 9

def events
  @events
end

#idObject (readonly)

Returns the value of attribute id.



9
10
11
# File 'lib/seatsio/domain.rb', line 9

def id
  @id
end

#keyObject (readonly)

Returns the value of attribute key.



9
10
11
# File 'lib/seatsio/domain.rb', line 9

def key
  @key
end

#nameObject (readonly)

Returns the value of attribute name.



9
10
11
# File 'lib/seatsio/domain.rb', line 9

def name
  @name
end

#published_version_thumbnail_urlObject (readonly)

Returns the value of attribute published_version_thumbnail_url.



9
10
11
# File 'lib/seatsio/domain.rb', line 9

def published_version_thumbnail_url
  @published_version_thumbnail_url
end

#social_distancing_rulesetsObject (readonly)

Returns the value of attribute social_distancing_rulesets.



9
10
11
# File 'lib/seatsio/domain.rb', line 9

def social_distancing_rulesets
  @social_distancing_rulesets
end

#statusObject (readonly)

Returns the value of attribute status.



9
10
11
# File 'lib/seatsio/domain.rb', line 9

def status
  @status
end

#tagsObject (readonly)

Returns the value of attribute tags.



9
10
11
# File 'lib/seatsio/domain.rb', line 9

def tags
  @tags
end

#validationObject (readonly)

Returns the value of attribute validation.



9
10
11
# File 'lib/seatsio/domain.rb', line 9

def validation
  @validation
end