Class: ForemanTasks::TroubleshootingHelpGenerator::Link

Inherits:
Object
  • Object
show all
Defined in:
app/services/foreman_tasks/troubleshooting_help_generator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, title:, description:, href:) ⇒ Link

Returns a new instance of Link.



6
7
8
9
10
11
# File 'app/services/foreman_tasks/troubleshooting_help_generator.rb', line 6

def initialize(name:, title:, description:, href:)
  @name = name
  @title = title
  @description = description
  @href = href
end

Instance Attribute Details

#descriptionObject

Returns the value of attribute description.



4
5
6
# File 'app/services/foreman_tasks/troubleshooting_help_generator.rb', line 4

def description
  @description
end

#hrefObject

Returns the value of attribute href.



4
5
6
# File 'app/services/foreman_tasks/troubleshooting_help_generator.rb', line 4

def href
  @href
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'app/services/foreman_tasks/troubleshooting_help_generator.rb', line 4

def name
  @name
end

#titleObject

Returns the value of attribute title.



4
5
6
# File 'app/services/foreman_tasks/troubleshooting_help_generator.rb', line 4

def title
  @title
end

Instance Method Details

#to_h(capitalize_title: false) ⇒ Object



13
14
15
16
# File 'app/services/foreman_tasks/troubleshooting_help_generator.rb', line 13

def to_h(capitalize_title: false)
  title = capitalize_title ? self.title.titlecase : self.title
  { name: name, title: title, description: description, href: href, external: true }
end