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:) ⇒ ServiceReply

Returns a new instance of ServiceReply.



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

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

  begin
    erb_reply = ERB.new(yaml_reply).result(context)
  rescue NameError => e
    raise(Stealth::Errors::UndefinedVariable, e.message)
  end

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

Instance Attribute Details

#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