Class: KudagoClient::Entities::Event
- Inherits:
-
Object
- Object
- KudagoClient::Entities::Event
- Defined in:
- lib/kudago_client/entities/event.rb
Defined Under Namespace
Classes: EventDate, Participant
Instance Attribute Summary collapse
-
#age_restriction ⇒ Object
Returns the value of attribute age_restriction.
-
#body_text ⇒ Object
Returns the value of attribute body_text.
-
#categories ⇒ Object
Returns the value of attribute categories.
-
#comments_count ⇒ Object
Returns the value of attribute comments_count.
-
#dates ⇒ Object
Returns the value of attribute dates.
-
#description ⇒ Object
Returns the value of attribute description.
-
#disable_comments ⇒ Object
Returns the value of attribute disable_comments.
-
#favorites_count ⇒ Object
Returns the value of attribute favorites_count.
-
#id ⇒ Object
Returns the value of attribute id.
-
#images ⇒ Object
Returns the value of attribute images.
-
#is_free ⇒ Object
Returns the value of attribute is_free.
-
#lang ⇒ Object
Returns the value of attribute lang.
-
#location ⇒ Object
Returns the value of attribute location.
-
#participants ⇒ Object
Returns the value of attribute participants.
-
#place ⇒ Object
Returns the value of attribute place.
-
#price ⇒ Object
Returns the value of attribute price.
-
#publication_date ⇒ Object
Returns the value of attribute publication_date.
-
#short_title ⇒ Object
Returns the value of attribute short_title.
-
#site_url ⇒ Object
Returns the value of attribute site_url.
-
#slug ⇒ Object
Returns the value of attribute slug.
-
#tagline ⇒ Object
Returns the value of attribute tagline.
-
#tags ⇒ Object
Returns the value of attribute tags.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
Constructor Details
#initialize(lang:, id: nil, publication_date: nil, body_text: nil, title: nil, slug: nil, description: nil, tagline: nil, age_restriction: nil, price: nil, is_free: false, favorites_count: nil, comments_count: nil, site_url: nil, short_title: nil, disable_comments: nil, dates: [], place: nil, location: nil, categories: [], images: [], tags: [], participants: []) ⇒ Event
Returns a new instance of Event.
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/kudago_client/entities/event.rb', line 27 def initialize(lang:, id: nil, publication_date: nil, body_text: nil, title: nil, slug: nil, description: nil, tagline: nil, age_restriction: nil, price: nil, is_free: false, favorites_count: nil, comments_count: nil, site_url: nil, short_title: nil, disable_comments: nil, dates: [], place: nil, location: nil, categories: [], images: [], tags: [], participants: []) @lang = lang @id = id @publication_date = Time.at(1467993495).to_datetime if publication_date @body_text = body_text @title = title @slug = slug @description = description @tagline = tagline @age_restriction = age_restriction @price = price @is_free = is_free @favorites_count = favorites_count @comments_count = comments_count @site_url = site_url @short_title = short_title @disable_comments = disable_comments @tags = @categories = categories&.map do |category_name| Entities::EventCategory.new(name: category_name, lang: lang) end @participants = participants&.map do |participant| Participant.new( Role.new(**participant[:role], lang: lang), Agent.new(**participant[:agent], lang: lang) ) end @dates = dates&.map do |date| EventDate.new( start_date: date[:start_date], start_time: date[:start_time], start: date[:start], end_date: date[:end_date], end_time: date[:end_time], end: date[:end], is_continuous: date[:is_continuous], is_endless: date[:is_endless], is_startless: date[:is_startless], schedules: date[:schedules], use_place_schedule: date[:use_place_schedule] ) end @place = Place.new(**place, lang: lang) if place @location = Location.new(**location, lang: lang) if location @images = images&.map do |image| KudagoClient::Entities::Image.new(image: image[:image], thumbnails: image[:thumbnails], source: image[:source]) end end |
Instance Attribute Details
#age_restriction ⇒ Object
Returns the value of attribute age_restriction.
23 24 25 |
# File 'lib/kudago_client/entities/event.rb', line 23 def age_restriction @age_restriction end |
#body_text ⇒ Object
Returns the value of attribute body_text.
23 24 25 |
# File 'lib/kudago_client/entities/event.rb', line 23 def body_text @body_text end |
#categories ⇒ Object
Returns the value of attribute categories.
23 24 25 |
# File 'lib/kudago_client/entities/event.rb', line 23 def categories @categories end |
#comments_count ⇒ Object
Returns the value of attribute comments_count.
23 24 25 |
# File 'lib/kudago_client/entities/event.rb', line 23 def comments_count @comments_count end |
#dates ⇒ Object
Returns the value of attribute dates.
23 24 25 |
# File 'lib/kudago_client/entities/event.rb', line 23 def dates @dates end |
#description ⇒ Object
Returns the value of attribute description.
23 24 25 |
# File 'lib/kudago_client/entities/event.rb', line 23 def description @description end |
#disable_comments ⇒ Object
Returns the value of attribute disable_comments.
23 24 25 |
# File 'lib/kudago_client/entities/event.rb', line 23 def disable_comments @disable_comments end |
#favorites_count ⇒ Object
Returns the value of attribute favorites_count.
23 24 25 |
# File 'lib/kudago_client/entities/event.rb', line 23 def favorites_count @favorites_count end |
#id ⇒ Object
Returns the value of attribute id.
23 24 25 |
# File 'lib/kudago_client/entities/event.rb', line 23 def id @id end |
#images ⇒ Object
Returns the value of attribute images.
23 24 25 |
# File 'lib/kudago_client/entities/event.rb', line 23 def images @images end |
#is_free ⇒ Object
Returns the value of attribute is_free.
23 24 25 |
# File 'lib/kudago_client/entities/event.rb', line 23 def is_free @is_free end |
#lang ⇒ Object
Returns the value of attribute lang.
23 24 25 |
# File 'lib/kudago_client/entities/event.rb', line 23 def lang @lang end |
#location ⇒ Object
Returns the value of attribute location.
23 24 25 |
# File 'lib/kudago_client/entities/event.rb', line 23 def location @location end |
#participants ⇒ Object
Returns the value of attribute participants.
23 24 25 |
# File 'lib/kudago_client/entities/event.rb', line 23 def participants @participants end |
#place ⇒ Object
Returns the value of attribute place.
23 24 25 |
# File 'lib/kudago_client/entities/event.rb', line 23 def place @place end |
#price ⇒ Object
Returns the value of attribute price.
23 24 25 |
# File 'lib/kudago_client/entities/event.rb', line 23 def price @price end |
#publication_date ⇒ Object
Returns the value of attribute publication_date.
23 24 25 |
# File 'lib/kudago_client/entities/event.rb', line 23 def publication_date @publication_date end |
#short_title ⇒ Object
Returns the value of attribute short_title.
23 24 25 |
# File 'lib/kudago_client/entities/event.rb', line 23 def short_title @short_title end |
#site_url ⇒ Object
Returns the value of attribute site_url.
23 24 25 |
# File 'lib/kudago_client/entities/event.rb', line 23 def site_url @site_url end |
#slug ⇒ Object
Returns the value of attribute slug.
23 24 25 |
# File 'lib/kudago_client/entities/event.rb', line 23 def slug @slug end |
#tagline ⇒ Object
Returns the value of attribute tagline.
23 24 25 |
# File 'lib/kudago_client/entities/event.rb', line 23 def tagline @tagline end |
#tags ⇒ Object
Returns the value of attribute tags.
23 24 25 |
# File 'lib/kudago_client/entities/event.rb', line 23 def @tags end |
#title ⇒ Object
Returns the value of attribute title.
23 24 25 |
# File 'lib/kudago_client/entities/event.rb', line 23 def title @title end |