Class: Y2Packager::ReleaseNotes

Inherits:
Object
  • Object
show all
Defined in:
src/lib/y2packager/release_notes.rb

Overview

Release notes for a given product

This class stores the content and some additional metadata about release notes for a given product.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(product_name:, content:, user_lang:, lang:, format:, version:) ⇒ ReleaseNotes

Constructor


42
43
44
45
46
47
48
49
# File 'src/lib/y2packager/release_notes.rb', line 42

def initialize(product_name:, content:, user_lang:, lang:, format:, version:)
  @product_name = product_name
  @content = content
  @user_lang = user_lang
  @lang = lang
  @version = version
  @format = format
end

Instance Attribute Details

#contentString (readonly)


24
25
26
# File 'src/lib/y2packager/release_notes.rb', line 24

def content
  @content
end

#formatSymbol (readonly)


30
31
32
# File 'src/lib/y2packager/release_notes.rb', line 30

def format
  @format
end

#langString (readonly)


28
29
30
# File 'src/lib/y2packager/release_notes.rb', line 28

def lang
  @lang
end

#product_nameString (readonly)


22
23
24
# File 'src/lib/y2packager/release_notes.rb', line 22

def product_name
  @product_name
end

#user_langString (readonly)


26
27
28
# File 'src/lib/y2packager/release_notes.rb', line 26

def user_lang
  @user_lang
end

#versionString (readonly)


32
33
34
# File 'src/lib/y2packager/release_notes.rb', line 32

def version
  @version
end

Instance Method Details

#matches?(user_lang, format, version) ⇒ Boolean

Determine whether a release notes matches language, format and version requirements


57
58
59
60
# File 'src/lib/y2packager/release_notes.rb', line 57

def matches?(user_lang, format, version)
  self.user_lang == user_lang && self.format == format &&
    (self.version == version || self.version == :latest)
end