Class: Plex::Library
- Inherits:
-
Object
- Object
- Plex::Library
- Defined in:
- lib/plex-ruby/library.rb
Instance Attribute Summary collapse
-
#server ⇒ Object
readonly
Returns the value of attribute server.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(server) ⇒ Library
constructor
A new instance of Library.
- #inspect ⇒ Object
- #key ⇒ Object
-
#section(id) ⇒ Section
Grab a specific section.
-
#section!(id) ⇒ Object
Cache busting version of #section.
-
#sections ⇒ Array
A list of sections that are located in this library.
-
#sections! ⇒ Object
Cache busting version of #sections.
- #url ⇒ Object
Constructor Details
#initialize(server) ⇒ Library
Returns a new instance of Library.
7 8 9 |
# File 'lib/plex-ruby/library.rb', line 7 def initialize(server) @server = server end |
Instance Attribute Details
#server ⇒ Object (readonly)
Returns the value of attribute server.
4 5 6 |
# File 'lib/plex-ruby/library.rb', line 4 def server @server end |
Instance Method Details
#==(other) ⇒ Object
47 48 49 50 51 52 53 |
# File 'lib/plex-ruby/library.rb', line 47 def ==(other) #:nodoc: if other.is_a? Library server == other.server else super end end |
#inspect ⇒ Object
56 57 58 |
# File 'lib/plex-ruby/library.rb', line 56 def inspect #:nodoc: "#<Plex::Libary: server=#{server.inspect}>" end |
#key ⇒ Object
37 38 39 |
# File 'lib/plex-ruby/library.rb', line 37 def key #:nodoc: "/library/sections" end |
#section(id) ⇒ Section
Grab a specific section
15 16 17 |
# File 'lib/plex-ruby/library.rb', line 15 def section(id) search_sections(xml_doc, id).first end |
#section!(id) ⇒ Object
Cache busting version of #section
20 21 22 |
# File 'lib/plex-ruby/library.rb', line 20 def section!(id) search_sections(xml_doc!, id).first end |
#sections ⇒ Array
A list of sections that are located in this library
27 28 29 |
# File 'lib/plex-ruby/library.rb', line 27 def sections @sections ||= search_sections(xml_doc) end |
#sections! ⇒ Object
Cache busting version of #sections
32 33 34 |
# File 'lib/plex-ruby/library.rb', line 32 def sections! @sections = search_sections(xml_doc!) end |
#url ⇒ Object
42 43 44 |
# File 'lib/plex-ruby/library.rb', line 42 def url #:nodoc: server.url end |