Class: Mindee::Product::Resume::ResumeV1SocialNetworksUrls

Inherits:
Array
  • Object
show all
Defined in:
lib/mindee/product/resume/resume_v1_social_networks_urls.rb

Overview

The list of social network profiles of the candidate.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(prediction, page_id) ⇒ ResumeV1SocialNetworksUrls

Returns a new instance of ResumeV1SocialNetworksUrls.

Parameters:

  • prediction (Array)
  • page_id (Integer, nil)


20
21
22
23
24
25
# File 'lib/mindee/product/resume/resume_v1_social_networks_urls.rb', line 20

def initialize(prediction, page_id)
  entries = prediction.map do |entry|
    Resume::ResumeV1SocialNetworksUrl.new(entry, page_id)
  end
  super(entries)
end

Instance Attribute Details

#entriesArray<ResumeV1SocialNetworksUrl> (readonly)

Entries.

Returns:



16
17
18
# File 'lib/mindee/product/resume/resume_v1_social_networks_urls.rb', line 16

def entries
  @entries
end

Class Method Details

.line_items_separator(char) ⇒ String

Creates a line of rST table-compliant string separators.

Parameters:

  • char (String)

    Character to use as a separator.

Returns:

  • (String)


30
31
32
33
34
35
# File 'lib/mindee/product/resume/resume_v1_social_networks_urls.rb', line 30

def self.line_items_separator(char)
  out_str = String.new
  out_str << "+#{char * 22}"
  out_str << "+#{char * 52}"
  out_str
end

Instance Method Details

#to_sString

Returns:

  • (String)


38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/mindee/product/resume/resume_v1_social_networks_urls.rb', line 38

def to_s
  return '' if empty?

  lines = map do |entry|
    "\n  #{entry.to_table_line}\n#{self.class.line_items_separator('-')}"
  end.join
  out_str = String.new
  out_str << ("\n#{self.class.line_items_separator('-')}\n ")
  out_str << ' | Name                '
  out_str << ' | URL                                               '
  out_str << (" |\n#{self.class.line_items_separator('=')}")
  out_str + lines
end