Class: Plex::Section
- Inherits:
-
Object
- Object
- Plex::Section
- Defined in:
- lib/plex-ruby/section.rb
Constant Summary collapse
- GROUPS =
%w(all unwatched newest recentlyAdded recentlyViewed onDeck)
- ATTRIBUTES =
%w(refreshing key type title art agent scanner language updatedAt)
- CATEGORIES =
%w(collection firstCharacter genre year contentRating folder)
Instance Attribute Summary collapse
-
#library ⇒ Object
readonly
Returns the value of attribute library.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(library, node) ⇒ Section
constructor
A new instance of Section.
- #inspect ⇒ Object
- #key ⇒ Object
-
#method ⇒ Array
Returns a list of shows or movies that are in this Section.
-
#refresh(deep = false, force = false) ⇒ Object
NOT IMPLEMENTED.
- #url ⇒ Object
Constructor Details
#initialize(library, node) ⇒ Section
Returns a new instance of Section.
16 17 18 19 20 21 |
# File 'lib/plex-ruby/section.rb', line 16 def initialize(library, node) @library = library ATTRIBUTES.each { |e| instance_variable_set("@#{Plex.underscore(e)}", node.attr(e)) } end |
Instance Attribute Details
#library ⇒ Object (readonly)
Returns the value of attribute library.
11 12 13 |
# File 'lib/plex-ruby/section.rb', line 11 def library @library end |
Instance Method Details
#==(other) ⇒ Object
90 91 92 93 94 95 96 |
# File 'lib/plex-ruby/section.rb', line 90 def ==(other) #:nodoc: if other.is_a? Plex::Section key == other.key else super end end |
#inspect ⇒ Object
99 100 101 |
# File 'lib/plex-ruby/section.rb', line 99 def inspect #:nodoc: "#<Plex::Section: key=\"#{key}\" type=\"#{type}\" title=\"#{title}\">" end |
#key ⇒ Object
80 81 82 |
# File 'lib/plex-ruby/section.rb', line 80 def key #:nodoc: "/library/sections/#{@key}" end |
#method ⇒ Array
Returns a list of shows or movies that are in this Section.
all - all videos in this Section unwatched - videos unwatched in this Section newest - most recent videos in this Section recently_added - recently added videos in this Section recently_viewed - recently viewed videos in this Section on_deck - videos that are “on deck” in this Section
38 39 40 41 42 43 44 |
# File 'lib/plex-ruby/section.rb', line 38 GROUPS.each { |method| class_eval %( def #{Plex.underscore(method)} Plex::Parser.new( self, Nokogiri::XML(Plex.open(url+key+'/#{method}')) ).parse end ) } |
#refresh(deep = false, force = false) ⇒ Object
NOT IMPLEMENTED
24 25 |
# File 'lib/plex-ruby/section.rb', line 24 def refresh(deep = false, force = false) end |
#url ⇒ Object
85 86 87 |
# File 'lib/plex-ruby/section.rb', line 85 def url #:nodoc: library.url end |