Class: KudagoClient::Entities::Place

Inherits:
Object
  • Object
show all
Defined in:
lib/kudago_client/entities/place.rb

Instance Attribute Summary collapse

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 = 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 = 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

#addressObject (readonly)

Returns the value of attribute address.



6
7
8
# File 'lib/kudago_client/entities/place.rb', line 6

def address
  @address
end

#age_restrictionObject (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_textObject (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

#categoriesObject (readonly)

Returns the value of attribute categories.



6
7
8
# File 'lib/kudago_client/entities/place.rb', line 6

def categories
  @categories
end

#comments_countObject (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

#coordsObject (readonly)

Returns the value of attribute coords.



6
7
8
# File 'lib/kudago_client/entities/place.rb', line 6

def coords
  @coords
end

#descriptionObject (readonly)

Returns the value of attribute description.



6
7
8
# File 'lib/kudago_client/entities/place.rb', line 6

def description
  @description
end

#disable_commentsObject (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_countObject (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_urlObject (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_lotObject (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

#idObject (readonly)

Returns the value of attribute id.



6
7
8
# File 'lib/kudago_client/entities/place.rb', line 6

def id
  @id
end

#imagesObject (readonly)

Returns the value of attribute images.



6
7
8
# File 'lib/kudago_client/entities/place.rb', line 6

def images
  @images
end

#is_closedObject (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_stubObject (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

#langObject (readonly)

Returns the value of attribute lang.



6
7
8
# File 'lib/kudago_client/entities/place.rb', line 6

def lang
  @lang
end

#locationObject (readonly)

Returns the value of attribute location.



6
7
8
# File 'lib/kudago_client/entities/place.rb', line 6

def location
  @location
end

#location_nameObject (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

#phoneObject (readonly)

Returns the value of attribute phone.



6
7
8
# File 'lib/kudago_client/entities/place.rb', line 6

def phone
  @phone
end

#short_titleObject (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_urlObject (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

#slugObject (readonly)

Returns the value of attribute slug.



6
7
8
# File 'lib/kudago_client/entities/place.rb', line 6

def slug
  @slug
end

#subwayObject (readonly)

Returns the value of attribute subway.



6
7
8
# File 'lib/kudago_client/entities/place.rb', line 6

def subway
  @subway
end

#tagsObject (readonly)

Returns the value of attribute tags.



6
7
8
# File 'lib/kudago_client/entities/place.rb', line 6

def tags
  @tags
end

#text_formatObject (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

#timetableObject (readonly)

Returns the value of attribute timetable.



6
7
8
# File 'lib/kudago_client/entities/place.rb', line 6

def timetable
  @timetable
end

#titleObject (readonly)

Returns the value of attribute title.



6
7
8
# File 'lib/kudago_client/entities/place.rb', line 6

def title
  @title
end