Class: Plex::Movie
- Inherits:
- 
      Object
      
        - Object
- Plex::Movie
 
- Defined in:
- lib/plex-ruby/movie.rb
Instance Attribute Summary collapse
- 
  
    
      #key  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    Returns the value of attribute key. 
- 
  
    
      #section  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    Returns the value of attribute section. 
Instance Method Summary collapse
- 
  
    
      #attribute_hash  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    Returns the attribute hash that represents this Movie. 
- 
  
    
      #initialize(section, key)  ⇒ Movie 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    A new instance of Movie. 
- #inspect ⇒ Object
- 
  
    
      #method_missing(method, *args, &block)  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    Delegates all method calls to the video object that represents this movie, if that video object responds to the method. 
- #methods ⇒ Object
- #respond_to?(method) ⇒ Boolean
- #url ⇒ Object
Constructor Details
#initialize(section, key) ⇒ Movie
Returns a new instance of Movie.
| 8 9 10 11 | # File 'lib/plex-ruby/movie.rb', line 8 def initialize(section, key) @section = section @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 movie, if that video object responds to the method.
| 20 21 22 23 24 25 26 | # File 'lib/plex-ruby/movie.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/movie.rb', line 4 def key @key end | 
#section ⇒ Object (readonly)
Returns the value of attribute section.
| 4 5 6 | # File 'lib/plex-ruby/movie.rb', line 4 def section @section end | 
Instance Method Details
#attribute_hash ⇒ Object
Returns the attribute hash that represents this Movie
| 14 15 16 | # File 'lib/plex-ruby/movie.rb', line 14 def attribute_hash video.attribute_hash.merge({'key' => key}) end | 
#inspect ⇒ Object
| 42 43 44 | # File 'lib/plex-ruby/movie.rb', line 42 def inspect #:nodoc: "#<Plex::Movie: key=\"#{key}\" title=\"#{title}\">" end | 
#methods ⇒ Object
| 32 33 34 | # File 'lib/plex-ruby/movie.rb', line 32 def methods (super + video.methods).uniq end | 
#respond_to?(method) ⇒ Boolean
| 28 29 30 | # File 'lib/plex-ruby/movie.rb', line 28 def respond_to?(method) super || video.respond_to?(method) end | 
#url ⇒ Object
| 37 38 39 | # File 'lib/plex-ruby/movie.rb', line 37 def url #:nodoc: section.url end |