Class: CXML::Response

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data = {}) ⇒ Response

Returns a new instance of Response.



12
13
14
15
16
# File 'lib/cxml/response.rb', line 12

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

Instance Attribute Details

#idObject

Returns the value of attribute id.



9
10
11
# File 'lib/cxml/response.rb', line 9

def id
  @id
end

#statusObject

Returns the value of attribute status.



10
11
12
# File 'lib/cxml/response.rb', line 10

def status
  @status
end

Instance Method Details

#render(node) ⇒ Object



18
19
20
21
22
# File 'lib/cxml/response.rb', line 18

def render(node)
  options = {:id => @id}
  options.keep_if { |k,v| !v.nil? }
  node.Response(options) { |n| @status.render(n) }
end