Class: VLC::System
- Inherits:
-
Object
- Object
- VLC::System
- Defined in:
- lib/vlc-client/system.rb
Overview
Local Client/Server VLC system
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
-
#initialize(*args) ⇒ VLC::Server
constructor
Creates a local VLC Client/Server system.
-
#method_missing(method, *args, &block) ⇒ Object
protected
Delegate to VLC::Client.
- #respond_to?(method, private_methods = false) ⇒ Boolean
- #server ⇒ Object
Constructor Details
#initialize(host, port, options) ⇒ VLC::Server #initialize ⇒ VLC::Server
Creates a local VLC Client/Server system
30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/vlc-client/system.rb', line 30 def initialize(*args) args = NullObject.Null?(args) opts = args. server = VLC::Server.new server.headless = opts.fetch(:headless, false) if args.size == 2 server.host = args.first.to_s server.port = Integer(args.last) end @client = VLC::Client.new(server, opts) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object (protected)
Delegate to VLC::Client
57 58 59 60 |
# File 'lib/vlc-client/system.rb', line 57 def method_missing(method, *args, &block) return super unless client.respond_to?(method) client.send(method, *args, &block) end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
4 5 6 |
# File 'lib/vlc-client/system.rb', line 4 def client @client end |
Instance Method Details
#respond_to?(method, private_methods = false) ⇒ Boolean
49 50 51 |
# File 'lib/vlc-client/system.rb', line 49 def respond_to?(method, private_methods = false) client.respond_to?(method, private_methods) || super(method, private_methods) end |
#server ⇒ Object
45 46 47 |
# File 'lib/vlc-client/system.rb', line 45 def server client.server end |