Class: BBC::Redux::Asset

Inherits:
Object
  • Object
show all
Defined in:
lib/bbc/redux/asset.rb

Overview

Redux API Asset Object

Examples:

Properties of the asset object


asset = redux_client.asset('5966413090093319525')

asset.channel     #=> BBC::Redux::Channel
asset.description #=> String
asset.duration    #=> Integer
asset.key         #=> BBC::Redux::Key
asset.name        #=> String
asset.pcrid       #=> BBC::Redux::Crid
asset.reference   #=> String
asset.scrid       #=> BBC::Redux::Crid
asset.start       #=> DateTime
asset.uuid        #=> String

Generating urls for the asset's associated media files


asset.dvbsubs_url     #=> BBC::Redux::MediaUrl
asset.flv_url         #=> BBC::Redux::MediaUrl
asset.h264_hi_url     #=> BBC::Redux::MediaUrl
asset.h264_lo_url     #=> BBC::Redux::MediaUrl
asset.mp3_url         #=> BBC::Redux::MediaUrl
asset.ts_url          #=> BBC::Redux::MediaUrl
asset.ts_stripped_url #=> BBC::Redux::MediaUrl

Author:

Instance Attribute Summary collapse

Instance Attribute Details

#channelChannel (readonly)

Returns the asset's channel

Returns:

  • (Channel)

    the asset's channel


44
# File 'lib/bbc/redux/asset.rb', line 44

attribute :channel, BBC::Redux::Channel

#cridsString (readonly)

Returns the assets's crids

Returns:

  • (String)

    the assets's crids


82
# File 'lib/bbc/redux/asset.rb', line 82

attribute :crids, Array[BBC::Redux::Crid], :default => [ ]

#descriptionString (readonly)

Returns the asset's description

Returns:

  • (String)

    the asset's description


48
# File 'lib/bbc/redux/asset.rb', line 48

attribute :description, String

#durationInteger (readonly)

Returns the asset's duration in seconds

Returns:

  • (Integer)

    the asset's duration in seconds


52
# File 'lib/bbc/redux/asset.rb', line 52

attribute :duration, Integer

#dvbsubs_urlBBC::Redux::MediaUrl (readonly)

Returns a media url for the dvbsubs file

Returns:


115
# File 'lib/bbc/redux/asset.rb', line 115

has_media_url :dvbsubs

#flv_urlBBC::Redux::MediaUrl (readonly)

Returns a media url for the flv file

Returns:


118
# File 'lib/bbc/redux/asset.rb', line 118

has_media_url :flv

#h264_hi_urlBBC::Redux::MediaUrl (readonly)

Returns a media url for the h264_hi file

Returns:


121
# File 'lib/bbc/redux/asset.rb', line 121

has_media_url :h264_hi

#h264_lo_urlBBC::Redux::MediaUrl (readonly)

Returns a media url for the h264_lo file

Returns:


124
# File 'lib/bbc/redux/asset.rb', line 124

has_media_url :h264_lo

#keyKey (readonly)

Returns the asset's access key object

Returns:

  • (Key)

    the asset's access key object


86
87
88
# File 'lib/bbc/redux/asset.rb', line 86

def key
  @key ||= Key.new(access_key)
end

#mp3_urlBBC::Redux::MediaUrl (readonly)

Returns a media url for the mp3 file

Returns:


127
# File 'lib/bbc/redux/asset.rb', line 127

has_media_url :mp3

#nameString (readonly) Also known as: title

Returns the asset's name / title

Returns:

  • (String)

    the asset's name / title


72
# File 'lib/bbc/redux/asset.rb', line 72

attribute :name, String

#pcridKey (readonly)

Returns the asset's programme crid

Returns:

  • (Key)

    the asset's programme crid


92
93
94
# File 'lib/bbc/redux/asset.rb', line 92

def pcrid
  @pcrid ||= crids.find { |c| c.description =~ /programme/ }
end

#referenceString (readonly) Also known as: disk_reference

Returns the asset's disk reference

Returns:

  • (String)

    the asset's disk reference


66
# File 'lib/bbc/redux/asset.rb', line 66

attribute :reference, String

#scridKey (readonly)

Returns the asset's series crid

Returns:

  • (Key)

    the asset's series crid


98
99
100
# File 'lib/bbc/redux/asset.rb', line 98

def scrid
  @scrid ||= crids.find { |c| c.description =~ /series/ }
end

#startDateTime (readonly)

time

Returns:

  • (DateTime)

    the asset's start date / time. Generally schedule


62
# File 'lib/bbc/redux/asset.rb', line 62

attribute :start,  DateTime

#ts_stripped_urlBBC::Redux::MediaUrl (readonly)

Returns a media url for the ts_stripped file

Returns:


133
# File 'lib/bbc/redux/asset.rb', line 133

has_media_url :ts_stripped

#ts_urlBBC::Redux::MediaUrl (readonly)

Returns a media url for the ts file

Returns:


130
# File 'lib/bbc/redux/asset.rb', line 130

has_media_url :ts

#uuidString (readonly)

Returns the assets's uuid

Returns:

  • (String)

    the assets's uuid


78
# File 'lib/bbc/redux/asset.rb', line 78

attribute :uuid, String