Class: KudagoClient::Entities::List
- Inherits:
-
Object
- Object
- KudagoClient::Entities::List
- Defined in:
- lib/kudago_client/entities/list.rb
Instance Attribute Summary collapse
-
#body_text ⇒ Object
Returns the value of attribute body_text.
-
#comments_count ⇒ Object
Returns the value of attribute comments_count.
-
#ctype ⇒ Object
Returns the value of attribute ctype.
-
#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.
-
#item_url ⇒ Object
Returns the value of attribute item_url.
-
#items ⇒ Object
Returns the value of attribute items.
-
#lang ⇒ Object
Returns the value of attribute lang.
-
#publication_date ⇒ Object
Returns the value of attribute publication_date.
-
#site_url ⇒ Object
Returns the value of attribute site_url.
-
#slug ⇒ Object
Returns the value of attribute slug.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(lang:, id: nil, ctype: "list", slug: nil, title: nil, publication_date: nil, favorites_count: nil, comments_count: nil, description: nil, body_text: nil, site_url: nil, item_url: nil, disable_comments: nil, items: [], images: []) ⇒ List
constructor
A new instance of List.
Constructor Details
#initialize(lang:, id: nil, ctype: "list", slug: nil, title: nil, publication_date: nil, favorites_count: nil, comments_count: nil, description: nil, body_text: nil, site_url: nil, item_url: nil, disable_comments: nil, items: [], images: []) ⇒ List
Returns a new instance of List.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/kudago_client/entities/list.rb', line 14 def initialize(lang:, id: nil, ctype: "list", slug: nil, title: nil, publication_date: nil, favorites_count: nil, comments_count: nil, description: nil, body_text: nil, site_url: nil, item_url: nil, disable_comments: nil, items: [], images: []) @lang = lang @id = id @ctype = ctype @slug = slug @title = title @favorites_count = favorites_count @comments_count = comments_count @description = description @body_text = body_text @site_url = site_url @item_url = item_url @disable_comments = disable_comments @items = KudagoClient::EntitiesList::MultipleList.new(results: items, lang: lang) if items @publication_date = Time.at(publication_date).to_datetime if publication_date @images = images&.map { |img| Image.new(**img) } end |
Instance Attribute Details
#body_text ⇒ Object
Returns the value of attribute body_text.
11 12 13 |
# File 'lib/kudago_client/entities/list.rb', line 11 def body_text @body_text end |
#comments_count ⇒ Object
Returns the value of attribute comments_count.
11 12 13 |
# File 'lib/kudago_client/entities/list.rb', line 11 def comments_count @comments_count end |
#ctype ⇒ Object
Returns the value of attribute ctype.
11 12 13 |
# File 'lib/kudago_client/entities/list.rb', line 11 def ctype @ctype end |
#description ⇒ Object
Returns the value of attribute description.
11 12 13 |
# File 'lib/kudago_client/entities/list.rb', line 11 def description @description end |
#disable_comments ⇒ Object
Returns the value of attribute disable_comments.
11 12 13 |
# File 'lib/kudago_client/entities/list.rb', line 11 def disable_comments @disable_comments end |
#favorites_count ⇒ Object
Returns the value of attribute favorites_count.
11 12 13 |
# File 'lib/kudago_client/entities/list.rb', line 11 def favorites_count @favorites_count end |
#id ⇒ Object
Returns the value of attribute id.
11 12 13 |
# File 'lib/kudago_client/entities/list.rb', line 11 def id @id end |
#images ⇒ Object
Returns the value of attribute images.
11 12 13 |
# File 'lib/kudago_client/entities/list.rb', line 11 def images @images end |
#item_url ⇒ Object
Returns the value of attribute item_url.
11 12 13 |
# File 'lib/kudago_client/entities/list.rb', line 11 def item_url @item_url end |
#items ⇒ Object
Returns the value of attribute items.
11 12 13 |
# File 'lib/kudago_client/entities/list.rb', line 11 def items @items end |
#lang ⇒ Object
Returns the value of attribute lang.
11 12 13 |
# File 'lib/kudago_client/entities/list.rb', line 11 def lang @lang end |
#publication_date ⇒ Object
Returns the value of attribute publication_date.
11 12 13 |
# File 'lib/kudago_client/entities/list.rb', line 11 def publication_date @publication_date end |
#site_url ⇒ Object
Returns the value of attribute site_url.
11 12 13 |
# File 'lib/kudago_client/entities/list.rb', line 11 def site_url @site_url end |
#slug ⇒ Object
Returns the value of attribute slug.
11 12 13 |
# File 'lib/kudago_client/entities/list.rb', line 11 def slug @slug end |
#title ⇒ Object
Returns the value of attribute title.
11 12 13 |
# File 'lib/kudago_client/entities/list.rb', line 11 def title @title end |