Class: XBMC_JSONRPC::APIBase
- Inherits:
-
Object
- Object
- XBMC_JSONRPC::APIBase
- Defined in:
- lib/xbmc-jsonrpc.rb
Overview
utility class for others to inherit from. For now uses method missing to make all calls to the send_command because there is no meaningful difference between namespaces / methods at the moment.
Direct Known Subclasses
AudioLibrary, AudioPlayer, AudioPlaylist, Files, JSONRPC, PicturePlayer, Player, Playlist, System, VideoLibrary, VideoPlayer, VideoPlaylist, XBMC
Class Method Summary collapse
-
.commands ⇒ Object
show commands for namespace.
-
.method_missing(method, args = {}) ⇒ Object
pass on namespace + method and arguments.
-
.namespace ⇒ Object
get the correct api namespace to use.
Class Method Details
.commands ⇒ Object
show commands for namespace
139 140 141 |
# File 'lib/xbmc-jsonrpc.rb', line 139 def self.commands XBMC_JSONRPC.commands.keys.grep(/#{self.namespace}\./) {|command| XBMC_JSONRPC.pp_command(command) } end |
.method_missing(method, args = {}) ⇒ Object
pass on namespace + method and arguments
134 135 136 |
# File 'lib/xbmc-jsonrpc.rb', line 134 def self.method_missing(method, args = {}) XBMC_JSONRPC.command("#{self.namespace}.#{method}", args) end |
.namespace ⇒ Object
get the correct api namespace to use
129 130 131 |
# File 'lib/xbmc-jsonrpc.rb', line 129 def self.namespace @namespace = @namespace || self.name.to_s.split('::')[1] end |