Class: Stealth::ServiceReply

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(recipient_id:, yaml_reply:, context:, preprocessor: :none) ⇒ ServiceReply

Returns a new instance of ServiceReply.



9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/stealth/service_reply.rb', line 9

def initialize(recipient_id:, yaml_reply:, context:, preprocessor: :none)
  @recipient_id = recipient_id
  @yaml_reply = yaml_reply
  @context = context

  processed_reply = case preprocessor
  when :erb
    preprocess_erb
  when :none
    @yaml_reply
  end

  @replies = load_replies(YAML.load(processed_reply))
end

Instance Attribute Details

#contextObject

Returns the value of attribute context.



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

def context
  @context
end

#recipient_idObject

Returns the value of attribute recipient_id.



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

def recipient_id
  @recipient_id
end

#repliesObject

Returns the value of attribute replies.



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

def replies
  @replies
end

#yaml_replyObject

Returns the value of attribute yaml_reply.



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

def yaml_reply
  @yaml_reply
end