Class: PiAgent::ExtensionUI::Request
- Inherits:
-
Object
- Object
- PiAgent::ExtensionUI::Request
- Defined in:
- lib/pi_agent/extension_ui.rb
Overview
One extension UI request. Wraps the raw protocol message.
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
Instance Method Summary collapse
- #[](key) ⇒ Object
- #dialog? ⇒ Boolean
-
#initialize(raw) ⇒ Request
constructor
A new instance of Request.
- #message ⇒ Object
- #notify_type ⇒ Object
- #options ⇒ Object
- #placeholder ⇒ Object
- #prefill ⇒ Object
- #text ⇒ Object
- #timeout_ms ⇒ Object
- #title ⇒ Object
Constructor Details
#initialize(raw) ⇒ Request
Returns a new instance of Request.
29 30 31 32 33 |
# File 'lib/pi_agent/extension_ui.rb', line 29 def initialize(raw) @raw = raw @id = raw["id"] @method = raw["method"]&.to_sym end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
27 28 29 |
# File 'lib/pi_agent/extension_ui.rb', line 27 def id @id end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
27 28 29 |
# File 'lib/pi_agent/extension_ui.rb', line 27 def method @method end |
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
27 28 29 |
# File 'lib/pi_agent/extension_ui.rb', line 27 def raw @raw end |
Instance Method Details
#[](key) ⇒ Object
48 49 50 |
# File 'lib/pi_agent/extension_ui.rb', line 48 def [](key) @raw[key.to_s] end |
#dialog? ⇒ Boolean
35 36 37 |
# File 'lib/pi_agent/extension_ui.rb', line 35 def dialog? DIALOG_METHODS.include?(@method) end |
#message ⇒ Object
40 |
# File 'lib/pi_agent/extension_ui.rb', line 40 def = @raw["message"] |
#notify_type ⇒ Object
45 |
# File 'lib/pi_agent/extension_ui.rb', line 45 def notify_type = @raw["notifyType"] |
#options ⇒ Object
41 |
# File 'lib/pi_agent/extension_ui.rb', line 41 def = @raw["options"] |
#placeholder ⇒ Object
42 |
# File 'lib/pi_agent/extension_ui.rb', line 42 def placeholder = @raw["placeholder"] |
#prefill ⇒ Object
43 |
# File 'lib/pi_agent/extension_ui.rb', line 43 def prefill = @raw["prefill"] |
#text ⇒ Object
46 |
# File 'lib/pi_agent/extension_ui.rb', line 46 def text = @raw["text"] |
#timeout_ms ⇒ Object
44 |
# File 'lib/pi_agent/extension_ui.rb', line 44 def timeout_ms = @raw["timeout"] |
#title ⇒ Object
39 |
# File 'lib/pi_agent/extension_ui.rb', line 39 def title = @raw["title"] |