Class: Sekken::Envelope

Inherits:
Object
  • Object
show all
Defined in:
lib/sekken/envelope.rb

Constant Summary collapse

NSID =
'lol'

Instance Method Summary collapse

Constructor Details

#initialize(operation, header, body) ⇒ Envelope

Returns a new instance of Envelope.



9
10
11
12
13
14
15
16
17
18
# File 'lib/sekken/envelope.rb', line 9

def initialize(operation, header, body)
  @logger = Logging.logger[self]

  @operation = operation
  @header = header || {}
  @body = body || {}

  @nsid_counter = -1
  @namespaces = {}
end

Instance Method Details

#register_namespace(namespace) ⇒ Object



20
21
22
# File 'lib/sekken/envelope.rb', line 20

def register_namespace(namespace)
  @namespaces[namespace] ||= create_nsid
end

#to_sObject



24
25
26
# File 'lib/sekken/envelope.rb', line 24

def to_s
  build_envelope(build_header, build_body)
end