Class: FSR::Cmd::Kill
Constant Summary
Constants inherited from Command
Instance Attribute Summary collapse
-
#uuid ⇒ Object
readonly
Returns the value of attribute uuid.
Instance Method Summary collapse
-
#initialize(fs_socket = nil, uuid_or_object) ⇒ Kill
constructor
A new instance of Kill.
-
#raw ⇒ Object
This method builds the API command to send to the freeswitch event socket.
-
#run(api_method = :api) ⇒ Object
Send the command to the event socket, using bgapi by default.
Constructor Details
#initialize(fs_socket = nil, uuid_or_object) ⇒ Kill
Returns a new instance of Kill.
7 8 9 10 11 12 13 14 15 |
# File 'lib/fsr/cmd/kill.rb', line 7 def initialize(fs_socket = nil, uuid_or_object) @fs_socket = fs_socket # FSR::CommandSocket obj # Either something that responds to :uuid or a string that is the uuid if uuid_or_object.respond_to?(:uuid) @uuid = uuid_or_object.uuid else @uuid = uuid_or_object end end |
Instance Attribute Details
#uuid ⇒ Object (readonly)
Returns the value of attribute uuid.
5 6 7 |
# File 'lib/fsr/cmd/kill.rb', line 5 def uuid @uuid end |
Instance Method Details
#raw ⇒ Object
This method builds the API command to send to the freeswitch event socket
25 26 27 |
# File 'lib/fsr/cmd/kill.rb', line 25 def raw orig_command = "uuid_kill #{uuid}" end |
#run(api_method = :api) ⇒ Object
Send the command to the event socket, using bgapi by default.
18 19 20 21 22 |
# File 'lib/fsr/cmd/kill.rb', line 18 def run(api_method = :api) orig_command = "%s %s" % [api_method, raw] Log.debug "saying #{orig_command}" @fs_socket.say(orig_command) end |