class TivoHMO::Adapters::Plex::Show

Attributes

delegate[R]

Public Class Methods

new(delegate) click to toggle source
Calls superclass method TivoHMO::API::Container::new
# File lib/tivohmo/adapters/plex/show.rb, line 12
def initialize(delegate)
  # delegate is a Plex::Show
  @delegate = delegate

  super(delegate.key)

  self.title = delegate.title
  self.modified_at = Time.at(delegate.updated_at.to_i)
  self.created_at = Time.at(delegate.added_at.to_i)
end

Public Instance Methods

children() click to toggle source
Calls superclass method
# File lib/tivohmo/adapters/plex/show.rb, line 23
def children
  synchronize do
    if super.blank?
      Array(delegate.seasons).each do |media|
        add_child(Season.new(media))
      end
    end
  end

  super
end