Class: Mindee::Product::Resume::ResumeV1SocialNetworksUrl

Inherits:
Mindee::Parsing::Standard::FeatureField show all
Includes:
Mindee::Parsing::Standard
Defined in:
lib/mindee/product/resume/resume_v1_social_networks_url.rb

Overview

The list of social network profiles of the candidate.

Instance Attribute Summary collapse

Attributes inherited from Mindee::Parsing::Standard::AbstractField

#bounding_box, #confidence, #page_id, #polygon

Instance Method Summary collapse

Methods inherited from Mindee::Parsing::Standard::FeatureField

#format_for_display

Methods inherited from Mindee::Parsing::Standard::AbstractField

array_confidence, array_sum, float_to_string

Constructor Details

#initialize(prediction, page_id) ⇒ ResumeV1SocialNetworksUrl

Returns a new instance of ResumeV1SocialNetworksUrl.

Parameters:

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


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

def initialize(prediction, page_id)
  super(prediction, page_id)
  @name = prediction['name']
  @url = prediction['url']
  @page_id = page_id
end

Instance Attribute Details

#nameString (readonly)

The name of the social network.

Returns:

  • (String)


13
14
15
# File 'lib/mindee/product/resume/resume_v1_social_networks_url.rb', line 13

def name
  @name
end

#urlString (readonly)

The URL of the social network.

Returns:

  • (String)


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

def url
  @url
end

Instance Method Details

#printable_valuesHash

Returns:

  • (Hash)


28
29
30
31
32
33
# File 'lib/mindee/product/resume/resume_v1_social_networks_url.rb', line 28

def printable_values
  printable = {}
  printable[:name] = format_for_display(@name)
  printable[:url] = format_for_display(@url)
  printable
end

#table_printable_valuesHash

Returns:

  • (Hash)


36
37
38
39
40
41
# File 'lib/mindee/product/resume/resume_v1_social_networks_url.rb', line 36

def table_printable_values
  printable = {}
  printable[:name] = format_for_display(@name, 20)
  printable[:url] = format_for_display(@url, 50)
  printable
end

#to_sString

Returns:

  • (String)


53
54
55
56
57
58
59
# File 'lib/mindee/product/resume/resume_v1_social_networks_url.rb', line 53

def to_s
  printable = printable_values
  out_str = String.new
  out_str << "\n  :Name: #{printable[:name]}"
  out_str << "\n  :URL: #{printable[:url]}"
  out_str
end

#to_table_lineString

Returns:

  • (String)


44
45
46
47
48
49
50
# File 'lib/mindee/product/resume/resume_v1_social_networks_url.rb', line 44

def to_table_line
  printable = table_printable_values
  out_str = String.new
  out_str << format('| %- 21s', printable[:name])
  out_str << format('| %- 51s', printable[:url])
  out_str << '|'
end