Class: Plex::Episode
- Inherits:
-
Object
- Object
- Plex::Episode
- Defined in:
- lib/plex-ruby/episode.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#season ⇒ Object
readonly
Returns the value of attribute season.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#attribute_hash ⇒ Object
Returns the attribute hash that represents this Episode.
-
#initialize(season, key) ⇒ Episode
constructor
A new instance of Episode.
- #inspect ⇒ Object
-
#method_missing(method, *args, &block) ⇒ Object
Delegates all method calls to the video object that represents this episode, if that video object responds to the method.
- #methods ⇒ Object
- #respond_to?(method) ⇒ Boolean
- #url ⇒ Object
Constructor Details
#initialize(season, key) ⇒ Episode
Returns a new instance of Episode.
8 9 10 11 |
# File 'lib/plex-ruby/episode.rb', line 8 def initialize(season, key) @season = season @key = key end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
Delegates all method calls to the video object that represents this episode, if that video object responds to the method.
20 21 22 23 24 25 26 |
# File 'lib/plex-ruby/episode.rb', line 20 def method_missing(method, *args, &block) if video.respond_to? method video.send(method, *args, &block) else super end end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
4 5 6 |
# File 'lib/plex-ruby/episode.rb', line 4 def key @key end |
#season ⇒ Object (readonly)
Returns the value of attribute season.
4 5 6 |
# File 'lib/plex-ruby/episode.rb', line 4 def season @season end |
Instance Method Details
#==(other) ⇒ Object
42 43 44 45 46 47 48 |
# File 'lib/plex-ruby/episode.rb', line 42 def ==(other) #:nodoc: if other.is_a? Plex::Episode key == other.key else super end end |
#attribute_hash ⇒ Object
Returns the attribute hash that represents this Episode
14 15 16 |
# File 'lib/plex-ruby/episode.rb', line 14 def attribute_hash video.attribute_hash.merge({'key' => key}) end |
#inspect ⇒ Object
51 52 53 |
# File 'lib/plex-ruby/episode.rb', line 51 def inspect #:nodoc: "#<Plex::Episode key=\"#{key}\" title=\"#{title}\" index=\"#{index}\" season=\"#{season.index}\" show=\"#{season.show.title}\">" end |
#methods ⇒ Object
32 33 34 |
# File 'lib/plex-ruby/episode.rb', line 32 def methods (super + video.methods).uniq end |
#respond_to?(method) ⇒ Boolean
28 29 30 |
# File 'lib/plex-ruby/episode.rb', line 28 def respond_to?(method) super || video.respond_to?(method) end |
#url ⇒ Object
37 38 39 |
# File 'lib/plex-ruby/episode.rb', line 37 def url #:nodoc: season.url end |