Class: Zenity::Message
Overview
Public: Boite de dialogue de message.
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#get_command ⇒ Object
Internal: Get the shell command for the dialog box.
-
#initialize(type, text) ⇒ Message
constructor
Public:.
Methods inherited from Base
#cancel?, #error?, #expired?, #ok?, #proceed
Constructor Details
#initialize(type, text) ⇒ Message
Public:
type - A String, the type of the message, one of:
'error'
'warning'
'question'
'info'
text - The text String to display in dialog box.
16 17 18 19 20 21 22 |
# File 'lib/zenity/message.rb', line 16 def initialize type, text if [:error, :warning, :question, :info].include? type @command = "zenity --#{type} --text=\"#{text}\"" else raise "Unknown message type #{type} for zenity message" end end |
Instance Method Details
#get_command ⇒ Object
Internal: Get the shell command for the dialog box. Used mostly for testing purposes.
Returns the shell command as a String
28 29 30 |
# File 'lib/zenity/message.rb', line 28 def get_command @command + end |