Class: Xbmc::Command
Overview
Representation of a XBMC JSON RPC method
Instance Attribute Summary collapse
-
#command ⇒ Object
readonly
Returns the value of attribute command.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#method_name ⇒ Object
readonly
Returns the value of attribute method_name.
-
#namespace ⇒ Object
readonly
Returns the value of attribute namespace.
-
#original_method ⇒ Object
readonly
Returns the value of attribute original_method.
Instance Method Summary collapse
-
#initialize(command_meta) ⇒ Command
constructor
Initializes a new command from the meta data hash given in JSONRPC.Introspect.
-
#invoke(params = {}) ⇒ Object
Invokes this command and processes the result.
-
#klass_name ⇒ Object
The ruby class name this command should end up in.
Constructor Details
#initialize(command_meta) ⇒ Command
Initializes a new command from the meta data hash given in JSONRPC.Introspect
6 7 8 9 10 11 |
# File 'lib/xbmc/command.rb', line 6 def initialize() @command_meta = .with_indifferent_access @description = [:description] @command = [:command] parse_command! end |
Instance Attribute Details
#command ⇒ Object (readonly)
Returns the value of attribute command.
3 4 5 |
# File 'lib/xbmc/command.rb', line 3 def command @command end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
3 4 5 |
# File 'lib/xbmc/command.rb', line 3 def description @description end |
#method_name ⇒ Object (readonly)
Returns the value of attribute method_name.
3 4 5 |
# File 'lib/xbmc/command.rb', line 3 def method_name @method_name end |
#namespace ⇒ Object (readonly)
Returns the value of attribute namespace.
3 4 5 |
# File 'lib/xbmc/command.rb', line 3 def namespace @namespace end |
#original_method ⇒ Object (readonly)
Returns the value of attribute original_method.
3 4 5 |
# File 'lib/xbmc/command.rb', line 3 def original_method @original_method end |
Instance Method Details
#invoke(params = {}) ⇒ Object
Invokes this command and processes the result
14 15 16 |
# File 'lib/xbmc/command.rb', line 14 def invoke(params={}) process_result(Xbmc.invoke_and_process(command, params)) end |
#klass_name ⇒ Object
The ruby class name this command should end up in
19 20 21 |
# File 'lib/xbmc/command.rb', line 19 def klass_name "Xbmc::#{namespace}" end |