Class: Punchblock::Component::Asterisk::AGI::Command::Complete::Success

Inherits:
Event::Complete::Reason show all
Defined in:
lib/punchblock/component/asterisk/agi/command.rb

Constant Summary

Constants inherited from RayoNode

RayoNode::InvalidNodeError

Instance Attribute Summary

Attributes inherited from RayoNode

#client, #component_id, #connection, #domain, #original_component, #target_call_id, #target_mixer_name

Instance Method Summary collapse

Methods inherited from Event::Complete::Reason

#name, new

Methods inherited from RayoNode

class_from_registration, #eql?, import, #inspect, new, register, #source

Instance Method Details

#codeObject



115
116
117
# File 'lib/punchblock/component/asterisk/agi/command.rb', line 115

def code
  code_node.text.to_i
end

#code=(other) ⇒ Object



119
120
121
# File 'lib/punchblock/component/asterisk/agi/command.rb', line 119

def code=(other)
  code_node.content = other
end

#code_nodeObject



103
104
105
# File 'lib/punchblock/component/asterisk/agi/command.rb', line 103

def code_node
  node_with_name 'code'
end

#dataObject



131
132
133
# File 'lib/punchblock/component/asterisk/agi/command.rb', line 131

def data
  data_node.text
end

#data=(other) ⇒ Object



135
136
137
# File 'lib/punchblock/component/asterisk/agi/command.rb', line 135

def data=(other)
  data_node.content = other
end

#data_nodeObject



111
112
113
# File 'lib/punchblock/component/asterisk/agi/command.rb', line 111

def data_node
  node_with_name 'data'
end

#inspect_attributesObject



139
140
141
# File 'lib/punchblock/component/asterisk/agi/command.rb', line 139

def inspect_attributes
  [:code, :result, :data]
end

#node_with_name(name) ⇒ Object



89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/punchblock/component/asterisk/agi/command.rb', line 89

def node_with_name(name)
  n = if self.class.registered_ns
    find_first "ns:#{name}", :ns => self.class.registered_ns
  else
    find_first name
  end

  unless n
    self << (n = RayoNode.new(name, self.document))
    n.namespace = self.class.registered_ns
  end
  n
end

#resultObject



123
124
125
# File 'lib/punchblock/component/asterisk/agi/command.rb', line 123

def result
  result_node.text.to_i
end

#result=(other) ⇒ Object



127
128
129
# File 'lib/punchblock/component/asterisk/agi/command.rb', line 127

def result=(other)
  result_node.content = other
end

#result_nodeObject



107
108
109
# File 'lib/punchblock/component/asterisk/agi/command.rb', line 107

def result_node
  node_with_name 'result'
end