Class: KudagoClient::Entities::Place
- Inherits:
-
Object
- Object
- KudagoClient::Entities::Place
- Defined in:
- lib/kudago_client/entities/place.rb
Instance Attribute Summary collapse
-
#address ⇒ Object
readonly
Returns the value of attribute address.
-
#age_restriction ⇒ Object
readonly
Returns the value of attribute age_restriction.
-
#body_text ⇒ Object
readonly
Returns the value of attribute body_text.
-
#categories ⇒ Object
readonly
Returns the value of attribute categories.
-
#comments_count ⇒ Object
readonly
Returns the value of attribute comments_count.
-
#coords ⇒ Object
readonly
Returns the value of attribute coords.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#disable_comments ⇒ Object
readonly
Returns the value of attribute disable_comments.
-
#favorites_count ⇒ Object
readonly
Returns the value of attribute favorites_count.
-
#foreign_url ⇒ Object
readonly
Returns the value of attribute foreign_url.
-
#has_parking_lot ⇒ Object
readonly
Returns the value of attribute has_parking_lot.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#images ⇒ Object
readonly
Returns the value of attribute images.
-
#is_closed ⇒ Object
readonly
Returns the value of attribute is_closed.
-
#is_stub ⇒ Object
readonly
Returns the value of attribute is_stub.
-
#lang ⇒ Object
readonly
Returns the value of attribute lang.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#location_name ⇒ Object
readonly
Returns the value of attribute location_name.
-
#phone ⇒ Object
readonly
Returns the value of attribute phone.
-
#short_title ⇒ Object
readonly
Returns the value of attribute short_title.
-
#site_url ⇒ Object
readonly
Returns the value of attribute site_url.
-
#slug ⇒ Object
readonly
Returns the value of attribute slug.
-
#subway ⇒ Object
readonly
Returns the value of attribute subway.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
-
#text_format ⇒ Object
readonly
Returns the value of attribute text_format.
-
#timetable ⇒ Object
readonly
Returns the value of attribute timetable.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
Constructor Details
#initialize(id: nil, lang: nil, title: nil, slug: nil, images: nil, address: nil, timetable: nil, phone: nil, description: nil, site_url: nil, is_stub: nil, body_text: nil, text_format: "html", disable_comments: nil, foreign_url: nil, coords: nil, subway: nil, favorites_count: nil, comments_count: nil, is_closed: nil, categories: nil, short_title: nil, tags: nil, location: nil, age_restriction: nil, has_parking_lot: nil) ⇒ Place
Returns a new instance of Place.
10 11 12 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 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/kudago_client/entities/place.rb', line 10 def initialize( id: nil, lang: nil, title: nil, slug: nil, images: nil, address: nil, timetable: nil, phone: nil, description: nil, site_url: nil, is_stub: nil, body_text: nil, text_format: "html", disable_comments: nil, foreign_url: nil, coords: nil, subway: nil, favorites_count: nil, comments_count: nil, is_closed: nil, categories: nil, short_title: nil, tags: nil, location: nil, age_restriction: nil, has_parking_lot: nil ) @lang = lang @id = id @slug = slug @title = title @address = address @timetable = @phone = phone @coords = coords @subway = subway @is_closed = is_closed @location_name = location @location = KudagoClient::Entities::Location.new(slug: location, lang:) if location.present? @site_url = site_url @foreign_url = foreign_url @text_format = text_format @description = description @body_text = body_text @is_stub = is_stub @disable_comments = disable_comments @favorites_count = favorites_count @comments_count = comments_count @categories = categories&.map do |category_name| Entities::PlaceCategory.new(name: category_name, lang: lang) end @short_title = short_title @tags = @age_restriction = age_restriction @has_parking_lot = has_parking_lot @images = images&.map do |image| KudagoClient::Entities::Image.new(image: image[:image], thumbnails: image[:thumbnails], source: image[:source]) end end |
Instance Attribute Details
#address ⇒ Object (readonly)
Returns the value of attribute address.
6 7 8 |
# File 'lib/kudago_client/entities/place.rb', line 6 def address @address end |
#age_restriction ⇒ Object (readonly)
Returns the value of attribute age_restriction.
6 7 8 |
# File 'lib/kudago_client/entities/place.rb', line 6 def age_restriction @age_restriction end |
#body_text ⇒ Object (readonly)
Returns the value of attribute body_text.
6 7 8 |
# File 'lib/kudago_client/entities/place.rb', line 6 def body_text @body_text end |
#categories ⇒ Object (readonly)
Returns the value of attribute categories.
6 7 8 |
# File 'lib/kudago_client/entities/place.rb', line 6 def categories @categories end |
#comments_count ⇒ Object (readonly)
Returns the value of attribute comments_count.
6 7 8 |
# File 'lib/kudago_client/entities/place.rb', line 6 def comments_count @comments_count end |
#coords ⇒ Object (readonly)
Returns the value of attribute coords.
6 7 8 |
# File 'lib/kudago_client/entities/place.rb', line 6 def coords @coords end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
6 7 8 |
# File 'lib/kudago_client/entities/place.rb', line 6 def description @description end |
#disable_comments ⇒ Object (readonly)
Returns the value of attribute disable_comments.
6 7 8 |
# File 'lib/kudago_client/entities/place.rb', line 6 def disable_comments @disable_comments end |
#favorites_count ⇒ Object (readonly)
Returns the value of attribute favorites_count.
6 7 8 |
# File 'lib/kudago_client/entities/place.rb', line 6 def favorites_count @favorites_count end |
#foreign_url ⇒ Object (readonly)
Returns the value of attribute foreign_url.
6 7 8 |
# File 'lib/kudago_client/entities/place.rb', line 6 def foreign_url @foreign_url end |
#has_parking_lot ⇒ Object (readonly)
Returns the value of attribute has_parking_lot.
6 7 8 |
# File 'lib/kudago_client/entities/place.rb', line 6 def has_parking_lot @has_parking_lot end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
6 7 8 |
# File 'lib/kudago_client/entities/place.rb', line 6 def id @id end |
#images ⇒ Object (readonly)
Returns the value of attribute images.
6 7 8 |
# File 'lib/kudago_client/entities/place.rb', line 6 def images @images end |
#is_closed ⇒ Object (readonly)
Returns the value of attribute is_closed.
6 7 8 |
# File 'lib/kudago_client/entities/place.rb', line 6 def is_closed @is_closed end |
#is_stub ⇒ Object (readonly)
Returns the value of attribute is_stub.
6 7 8 |
# File 'lib/kudago_client/entities/place.rb', line 6 def is_stub @is_stub end |
#lang ⇒ Object (readonly)
Returns the value of attribute lang.
6 7 8 |
# File 'lib/kudago_client/entities/place.rb', line 6 def lang @lang end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
6 7 8 |
# File 'lib/kudago_client/entities/place.rb', line 6 def location @location end |
#location_name ⇒ Object (readonly)
Returns the value of attribute location_name.
6 7 8 |
# File 'lib/kudago_client/entities/place.rb', line 6 def location_name @location_name end |
#phone ⇒ Object (readonly)
Returns the value of attribute phone.
6 7 8 |
# File 'lib/kudago_client/entities/place.rb', line 6 def phone @phone end |
#short_title ⇒ Object (readonly)
Returns the value of attribute short_title.
6 7 8 |
# File 'lib/kudago_client/entities/place.rb', line 6 def short_title @short_title end |
#site_url ⇒ Object (readonly)
Returns the value of attribute site_url.
6 7 8 |
# File 'lib/kudago_client/entities/place.rb', line 6 def site_url @site_url end |
#slug ⇒ Object (readonly)
Returns the value of attribute slug.
6 7 8 |
# File 'lib/kudago_client/entities/place.rb', line 6 def slug @slug end |
#subway ⇒ Object (readonly)
Returns the value of attribute subway.
6 7 8 |
# File 'lib/kudago_client/entities/place.rb', line 6 def subway @subway end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
6 7 8 |
# File 'lib/kudago_client/entities/place.rb', line 6 def @tags end |
#text_format ⇒ Object (readonly)
Returns the value of attribute text_format.
6 7 8 |
# File 'lib/kudago_client/entities/place.rb', line 6 def text_format @text_format end |
#timetable ⇒ Object (readonly)
Returns the value of attribute timetable.
6 7 8 |
# File 'lib/kudago_client/entities/place.rb', line 6 def @timetable end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
6 7 8 |
# File 'lib/kudago_client/entities/place.rb', line 6 def title @title end |