Class: Plex::Server

Inherits:
Object
  • Object
show all
Defined in:
lib/plex-ruby/server.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(host, port) ⇒ Server

Returns a new instance of Server.



6
7
8
9
# File 'lib/plex-ruby/server.rb', line 6

def initialize(host, port)
  @host = host
  @port = port
end

Instance Attribute Details

#hostObject (readonly)

Returns the value of attribute host.



4
5
6
# File 'lib/plex-ruby/server.rb', line 4

def host
  @host
end

#portObject (readonly)

Returns the value of attribute port.



4
5
6
# File 'lib/plex-ruby/server.rb', line 4

def port
  @port
end

Instance Method Details

#clientsArray

The Plex clients that are connected to this Server

Returns:

  • (Array)

    list of Clients connected to this server



21
22
23
# File 'lib/plex-ruby/server.rb', line 21

def clients
  @clients ||= search_clients clients_doc
end

#clients!Object

Cache busting version of #clients



26
27
28
# File 'lib/plex-ruby/server.rb', line 26

def clients!
  @clients = search_clients clients_doc!
end

#inspectObject



36
37
38
# File 'lib/plex-ruby/server.rb', line 36

def inspect #:nodoc:
  "#<Plex::Server: host=#{host} port=#{port}>"
end

#libraryLibrary

The library of this server

Returns:

  • (Library)

    this Servers library



14
15
16
# File 'lib/plex-ruby/server.rb', line 14

def library
  @library ||= Plex::Library.new(self)
end

#urlObject



31
32
33
# File 'lib/plex-ruby/server.rb', line 31

def url #:nodoc:
  "http://#{host}:#{port}"
end