Class: Zenity::Message

Inherits:
Base
  • Object
show all
Defined in:
lib/zenity/message.rb

Overview

Public: Boite de dialogue de message.

Instance Attribute Summary

Attributes inherited from Base

#exit_status

Instance Method Summary collapse

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_commandObject

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 + general_options
end