Class: Stealth::Reply
- Inherits:
-
Object
- Object
- Stealth::Reply
- Defined in:
- lib/stealth/reply.rb
Instance Attribute Summary collapse
-
#reply ⇒ Object
Returns the value of attribute reply.
-
#reply_type ⇒ Object
Returns the value of attribute reply_type.
Class Method Summary collapse
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, value) ⇒ Object
- #delay? ⇒ Boolean
-
#initialize(unstructured_reply:) ⇒ Reply
constructor
A new instance of Reply.
Constructor Details
#initialize(unstructured_reply:) ⇒ Reply
Returns a new instance of Reply.
9 10 11 12 |
# File 'lib/stealth/reply.rb', line 9 def initialize(unstructured_reply:) @reply_type = unstructured_reply["reply_type"] @reply = unstructured_reply end |
Instance Attribute Details
#reply ⇒ Object
Returns the value of attribute reply.
7 8 9 |
# File 'lib/stealth/reply.rb', line 7 def reply @reply end |
#reply_type ⇒ Object
Returns the value of attribute reply_type.
7 8 9 |
# File 'lib/stealth/reply.rb', line 7 def reply_type @reply_type end |
Class Method Details
.dynamic_delay ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'lib/stealth/reply.rb', line 26 def self.dynamic_delay self.new( unstructured_reply: { 'reply_type' => 'delay', 'duration' => 'dynamic' } ) end |
Instance Method Details
#[](key) ⇒ Object
14 15 16 |
# File 'lib/stealth/reply.rb', line 14 def [](key) @reply[key] end |
#[]=(key, value) ⇒ Object
18 19 20 |
# File 'lib/stealth/reply.rb', line 18 def []=(key, value) @reply[key] = value end |
#delay? ⇒ Boolean
22 23 24 |
# File 'lib/stealth/reply.rb', line 22 def delay? reply_type == 'delay' end |