Class: KudagoClient::Entities::Agent
- Inherits:
-
Object
- Object
- KudagoClient::Entities::Agent
- Defined in:
- lib/kudago_client/entities/agent.rb
Defined Under Namespace
Classes: Participation
Instance Attribute Summary collapse
-
#agent_type ⇒ Object
readonly
Returns the value of attribute agent_type.
-
#body_text ⇒ Object
readonly
Returns the value of attribute body_text.
-
#comments_count ⇒ Object
readonly
Returns the value of attribute comments_count.
-
#ctype ⇒ Object
readonly
Returns the value of attribute ctype.
-
#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.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#images ⇒ Object
readonly
Returns the value of attribute images.
-
#is_stub ⇒ Object
readonly
Returns the value of attribute is_stub.
-
#lang ⇒ Object
readonly
Returns the value of attribute lang.
-
#participations ⇒ Object
readonly
Returns the value of attribute participations.
-
#rank ⇒ Object
readonly
Returns the value of attribute rank.
-
#site_url ⇒ Object
readonly
Returns the value of attribute site_url.
-
#slug ⇒ Object
readonly
Returns the value of attribute slug.
-
#text_format ⇒ Object
readonly
Returns the value of attribute text_format.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(lang:, text_format: "html", id: nil, title: nil, slug: nil, favorites_count: nil, comments_count: nil, description: nil, body_text: nil, site_url: nil, disable_comments: nil, ctype: nil, images: nil, agent_type: nil, rank: nil, participations: nil, is_stub: nil) ⇒ Agent
constructor
A new instance of Agent.
Constructor Details
#initialize(lang:, text_format: "html", id: nil, title: nil, slug: nil, favorites_count: nil, comments_count: nil, description: nil, body_text: nil, site_url: nil, disable_comments: nil, ctype: nil, images: nil, agent_type: nil, rank: nil, participations: nil, is_stub: nil) ⇒ Agent
Returns a new instance of Agent.
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 |
# File 'lib/kudago_client/entities/agent.rb', line 28 def initialize( lang:, text_format: "html", id: nil, title: nil, slug: nil, favorites_count: nil, comments_count: nil, description: nil, body_text: nil, site_url: nil, disable_comments: nil, ctype: nil, images: nil, agent_type: nil, rank: nil, participations: nil, is_stub: nil ) @lang = lang @id = id @agent_type = agent_type @body_text = body_text @comments_count = comments_count @ctype = ctype @description = description @disable_comments = disable_comments @favorites_count = favorites_count @is_stub = is_stub @rank = rank @site_url = site_url @slug = slug @text_format = text_format @title = title @images = images&.map do |image| KudagoClient::Entities::Image.new(image: image[:image], thumbnails: image[:thumbnails], source: image[:source]) end @participations = participations&.map do |participation| Participation.new( Role.new(**participation[:role], lang: lang), (participation[:item][:ctype] == "event") ? Event.new(**participation[:item].except(:ctype), lang: lang) : nil ) end end |
Instance Attribute Details
#agent_type ⇒ Object (readonly)
Returns the value of attribute agent_type.
25 26 27 |
# File 'lib/kudago_client/entities/agent.rb', line 25 def agent_type @agent_type end |
#body_text ⇒ Object (readonly)
Returns the value of attribute body_text.
25 26 27 |
# File 'lib/kudago_client/entities/agent.rb', line 25 def body_text @body_text end |
#comments_count ⇒ Object (readonly)
Returns the value of attribute comments_count.
25 26 27 |
# File 'lib/kudago_client/entities/agent.rb', line 25 def comments_count @comments_count end |
#ctype ⇒ Object (readonly)
Returns the value of attribute ctype.
25 26 27 |
# File 'lib/kudago_client/entities/agent.rb', line 25 def ctype @ctype end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
25 26 27 |
# File 'lib/kudago_client/entities/agent.rb', line 25 def description @description end |
#disable_comments ⇒ Object (readonly)
Returns the value of attribute disable_comments.
25 26 27 |
# File 'lib/kudago_client/entities/agent.rb', line 25 def disable_comments @disable_comments end |
#favorites_count ⇒ Object (readonly)
Returns the value of attribute favorites_count.
25 26 27 |
# File 'lib/kudago_client/entities/agent.rb', line 25 def favorites_count @favorites_count end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
25 26 27 |
# File 'lib/kudago_client/entities/agent.rb', line 25 def id @id end |
#images ⇒ Object (readonly)
Returns the value of attribute images.
25 26 27 |
# File 'lib/kudago_client/entities/agent.rb', line 25 def images @images end |
#is_stub ⇒ Object (readonly)
Returns the value of attribute is_stub.
25 26 27 |
# File 'lib/kudago_client/entities/agent.rb', line 25 def is_stub @is_stub end |
#lang ⇒ Object (readonly)
Returns the value of attribute lang.
25 26 27 |
# File 'lib/kudago_client/entities/agent.rb', line 25 def lang @lang end |
#participations ⇒ Object (readonly)
Returns the value of attribute participations.
25 26 27 |
# File 'lib/kudago_client/entities/agent.rb', line 25 def participations @participations end |
#rank ⇒ Object (readonly)
Returns the value of attribute rank.
25 26 27 |
# File 'lib/kudago_client/entities/agent.rb', line 25 def rank @rank end |
#site_url ⇒ Object (readonly)
Returns the value of attribute site_url.
25 26 27 |
# File 'lib/kudago_client/entities/agent.rb', line 25 def site_url @site_url end |
#slug ⇒ Object (readonly)
Returns the value of attribute slug.
25 26 27 |
# File 'lib/kudago_client/entities/agent.rb', line 25 def slug @slug end |
#text_format ⇒ Object (readonly)
Returns the value of attribute text_format.
25 26 27 |
# File 'lib/kudago_client/entities/agent.rb', line 25 def text_format @text_format end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
25 26 27 |
# File 'lib/kudago_client/entities/agent.rb', line 25 def title @title end |