Class: CXML::Sender

Inherits:
Object
  • Object
show all
Defined in:
lib/cxml/sender.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data = {}) ⇒ Sender

Returns a new instance of Sender.



6
7
8
9
10
11
# File 'lib/cxml/sender.rb', line 6

def initialize(data={})
  if data.kind_of?(Hash) && !data.empty?
    @credential = CXML::Credential.new(data['Credential'])
    @user_agent = data['UserAgent']
  end
end

Instance Attribute Details

#credentialObject

Returns the value of attribute credential.



3
4
5
# File 'lib/cxml/sender.rb', line 3

def credential
  @credential
end

#user_agentObject

Returns the value of attribute user_agent.



4
5
6
# File 'lib/cxml/sender.rb', line 4

def user_agent
  @user_agent
end

Instance Method Details

#render(node) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/cxml/sender.rb', line 13

def render(node)
  node.Sender do |n|
    n.UserAgent(@user_agent)
    @credential.render(n)
  end
  node
end