Class: Plex::Part
- Inherits:
- 
      Object
      
        - Object
- Plex::Part
 
- Defined in:
- lib/plex-ruby/part.rb
Constant Summary collapse
- ATTRIBUTES =
- %w(id key duration file size)
Instance Attribute Summary collapse
- 
  
    
      #streams  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    Returns the value of attribute streams. 
Instance Method Summary collapse
- #==(other) ⇒ Object
- 
  
    
      #initialize(node)  ⇒ Part 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    A new instance of Part. 
Constructor Details
#initialize(node) ⇒ Part
Returns a new instance of Part.
| 10 11 12 13 14 15 16 17 18 | # File 'lib/plex-ruby/part.rb', line 10 def initialize(node) node.attributes.each do |method, val| define_singleton_method(Plex.underscore(method).to_sym) do val.value end end @streams = node.search('Stream').map { |m| Plex::Stream.new(m) } end | 
Instance Attribute Details
#streams ⇒ Object (readonly)
Returns the value of attribute streams.
| 6 7 8 | # File 'lib/plex-ruby/part.rb', line 6 def streams @streams end | 
Instance Method Details
#==(other) ⇒ Object
| 20 21 22 23 24 25 26 | # File 'lib/plex-ruby/part.rb', line 20 def ==(other) if other.is_a? Plex::Part id == other.id else super end end |