Class: Stealth::Reply

Inherits:
Object
  • Object
show all
Defined in:
lib/stealth/reply.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#replyObject

Returns the value of attribute reply.



7
8
9
# File 'lib/stealth/reply.rb', line 7

def reply
  @reply
end

#reply_typeObject

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_delayObject



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

Returns:

  • (Boolean)


22
23
24
# File 'lib/stealth/reply.rb', line 22

def delay?
  reply_type == 'delay'
end