Class: SecretService::Prompt
- Inherits:
-
Object
- Object
- SecretService::Prompt
- Defined in:
- lib/secret_service/prompt.rb
Defined Under Namespace
Classes: NoPromptRequired
Instance Attribute Summary collapse
-
#path ⇒ Object
Returns the value of attribute path.
Instance Method Summary collapse
- #dismiss ⇒ Object
-
#initialize(service, object_path) ⇒ Prompt
constructor
A new instance of Prompt.
- #prompt! ⇒ Object
Constructor Details
#initialize(service, object_path) ⇒ Prompt
Returns a new instance of Prompt.
8 9 10 11 12 13 |
# File 'lib/secret_service/prompt.rb', line 8 def initialize service, object_path raise NoPromptRequired if object_path == "/" @service = service @path = object_path @proxy = service.get_proxy object_path, SecretService::IFACE[:prompt] end |
Instance Attribute Details
#path ⇒ Object
Returns the value of attribute path.
4 5 6 |
# File 'lib/secret_service/prompt.rb', line 4 def path @path end |
Instance Method Details
#dismiss ⇒ Object
25 26 27 |
# File 'lib/secret_service/prompt.rb', line 25 def dismiss @proxy.Dismiss end |
#prompt! ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/secret_service/prompt.rb', line 15 def prompt! loop = DBus::Main.new loop << @service.bus @proxy.on_signal("Completed") do |dismissed, result| loop.quit end @proxy.Prompt "" loop.run end |