Class: Packages::UpdateMessagesView
- Inherits:
-
Object
- Object
- Packages::UpdateMessagesView
- Extended by:
- Yast::I18n
- Includes:
- Yast::I18n
- Defined in:
- library/packages/src/lib/packages/update_messages_view.rb
Overview
This class converts a set of libzypp update messages into string representations.
At this time, richtext is the only provided conversion.
Instance Method Summary collapse
-
#initialize(messages) ⇒ UpdateMessagesView
constructor
A new instance of UpdateMessagesView.
-
#richtext ⇒ String
Gets richtext representation of messages passed to constructor.
Constructor Details
#initialize(messages) ⇒ UpdateMessagesView
Returns a new instance of UpdateMessagesView.
13 14 15 16 17 |
# File 'library/packages/src/lib/packages/update_messages_view.rb', line 13 def initialize() Yast.import "String" textdomain "base" @messages = end |
Instance Method Details
#richtext ⇒ String
Gets richtext representation of messages passed to constructor
22 23 24 25 26 27 |
# File 'library/packages/src/lib/packages/update_messages_view.rb', line 22 def richtext text = "<h1>" + _("Packages notifications") + "</h1>\n<p>" \ + _("You have notifications from the following packages:") + "</p>" text << richtext_toc(@messages) if @messages.size > 1 text << @messages.map { |m| (m) }.join("<hr>") end |