Class: Plex::Media
- Inherits:
-
Object
- Object
- Plex::Media
- Defined in:
- lib/plex-ruby/media.rb
Constant Summary collapse
- ATTRIBUTES =
%w(id durration bitrate aspectRatio audioChannels audioCodec videoCodec videoResolution container videoFrameRate)
Instance Attribute Summary collapse
-
#parts ⇒ Object
readonly
Returns the value of attribute parts.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(node) ⇒ Media
constructor
A new instance of Media.
Constructor Details
#initialize(node) ⇒ Media
Returns a new instance of Media.
11 12 13 14 15 16 17 18 19 |
# File 'lib/plex-ruby/media.rb', line 11 def initialize(node) node.attributes.each do |method, val| define_singleton_method(Plex.underscore(method).to_sym) do val.value end end @parts = node.search("Part").map { |m| Plex::Part.new(m) } end |
Instance Attribute Details
#parts ⇒ Object (readonly)
Returns the value of attribute parts.
7 8 9 |
# File 'lib/plex-ruby/media.rb', line 7 def parts @parts end |
Instance Method Details
#==(other) ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/plex-ruby/media.rb', line 21 def ==(other) if other.is_a? Media id == other.id else super end end |