Class: Zenity::Base
- Inherits:
-
Object
- Object
- Zenity::Base
- Defined in:
- lib/zenity/base.rb
Overview
Internal: Base class for all dialog boxes.
Instance Attribute Summary collapse
-
#exit_status ⇒ Object
readonly
Returns the value of attribute exit_status.
-
#height ⇒ Object
writeonly
Sets the attribute height.
-
#title ⇒ Object
writeonly
Sets the attribute title.
-
#width ⇒ Object
writeonly
Sets the attribute width.
Instance Method Summary collapse
- #cancel? ⇒ Boolean
- #error? ⇒ Boolean
- #expired? ⇒ Boolean
-
#initialize ⇒ Base
constructor
A new instance of Base.
- #ok? ⇒ Boolean
- #proceed ⇒ Object
Constructor Details
#initialize ⇒ Base
Returns a new instance of Base.
10 11 12 |
# File 'lib/zenity/base.rb', line 10 def initialize @exit_status = nil end |
Instance Attribute Details
#exit_status ⇒ Object (readonly)
Returns the value of attribute exit_status.
8 9 10 |
# File 'lib/zenity/base.rb', line 8 def exit_status @exit_status end |
#height=(value) ⇒ Object
Sets the attribute height
7 8 9 |
# File 'lib/zenity/base.rb', line 7 def height=(value) @height = value end |
#title=(value) ⇒ Object
Sets the attribute title
7 8 9 |
# File 'lib/zenity/base.rb', line 7 def title=(value) @title = value end |
#width=(value) ⇒ Object
Sets the attribute width
7 8 9 |
# File 'lib/zenity/base.rb', line 7 def width=(value) @width = value end |
Instance Method Details
#cancel? ⇒ Boolean
24 25 26 |
# File 'lib/zenity/base.rb', line 24 def cancel? @exit_status == CANCEL end |
#error? ⇒ Boolean
28 29 30 |
# File 'lib/zenity/base.rb', line 28 def error? @exit_status == ERROR end |
#expired? ⇒ Boolean
32 33 34 |
# File 'lib/zenity/base.rb', line 32 def expired? @exit_status == EXPIRED end |
#proceed ⇒ Object
14 15 16 17 18 |
# File 'lib/zenity/base.rb', line 14 def proceed ret = %x[ #{get_command} ] @exit_status = $?.exitstatus ret.delete("\n") end |