Class: NPR::Audio

Inherits:
Content show all
Defined in:
lib/rubynpr/audio.rb

Overview

Audio represents all the available audio that is packaged with a particular story. Audio features the following attributes:

  • id: the unique ID for the audio

  • duration: the duration in seconds of the audio

  • title: the title of the audio piece

  • formats: audio pieces come in three different formats: MP3, Windows Media, and Real Audio. Audio of the different formats can be accessed by a hash like so: audio.formats[:mp3]. Hash options are :mp3, :wm, :rm, and :ram. :ram is more likely to show up with older stories.

Constant Summary collapse

FORMATS =
[:mp3, :wm, :rm, :ram]

Instance Attribute Summary collapse

Method Summary

Methods inherited from Content

#initialize

Constructor Details

This class inherits a constructor from NPR::Content

Instance Attribute Details

#durationObject

Returns the value of attribute duration.



15
16
17
# File 'lib/rubynpr/audio.rb', line 15

def duration
  @duration
end

#formatsObject

Returns the value of attribute formats.



15
16
17
# File 'lib/rubynpr/audio.rb', line 15

def formats
  @formats
end

#idObject

Returns the value of attribute id.



15
16
17
# File 'lib/rubynpr/audio.rb', line 15

def id
  @id
end

#mp3_rightsObject

Returns the value of attribute mp3_rights.



15
16
17
# File 'lib/rubynpr/audio.rb', line 15

def mp3_rights
  @mp3_rights
end

#rights_holderObject

Returns the value of attribute rights_holder.



15
16
17
# File 'lib/rubynpr/audio.rb', line 15

def rights_holder
  @rights_holder
end

#titleObject

Returns the value of attribute title.



15
16
17
# File 'lib/rubynpr/audio.rb', line 15

def title
  @title
end

#typeObject

Returns the value of attribute type.



15
16
17
# File 'lib/rubynpr/audio.rb', line 15

def type
  @type
end