Class: YouTube::VideoDetails

Inherits:
Object
  • Object
show all
Defined in:
lib/youtube.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(payload) ⇒ VideoDetails

Returns a new instance of VideoDetails.



347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
# File 'lib/youtube.rb', line 347

def initialize(payload)
  @author = payload['author'].to_s
  @channel_list = payload['channel_list']
  @comment_list = payload['comment_list']
  @description = payload['description'].to_s
  @length_seconds = payload['length_seconds'].to_i
  @rating_avg = payload['rating_avg'].to_f
  @rating_count = payload['rating_count'].to_i
  @recording_country = payload['recording_country'].to_s
  @recording_date = payload['recording_date'].to_s
  @recording_location = payload['recording_location'].to_s
  @tags = payload['tags']
  @thumbnail_url = payload['thumbnail_url']
  @title = payload['title'].to_s
  @update_time = YouTube._string_to_time(payload['update_time'])
  @upload_time = YouTube._string_to_time(payload['upload_time'])
  @view_count = payload['view_count'].to_i
  @embed_status = payload['embed_status']
  @embed_allowed = ( payload['embed_status'] == "ok" )
end

Instance Attribute Details

#authorObject (readonly)

Returns the value of attribute author.



328
329
330
# File 'lib/youtube.rb', line 328

def author
  @author
end

#channel_listObject (readonly)

Returns the value of attribute channel_list.



329
330
331
# File 'lib/youtube.rb', line 329

def channel_list
  @channel_list
end

#comment_listObject (readonly)

Returns the value of attribute comment_list.



330
331
332
# File 'lib/youtube.rb', line 330

def comment_list
  @comment_list
end

#descriptionObject (readonly)

Returns the value of attribute description.



331
332
333
# File 'lib/youtube.rb', line 331

def description
  @description
end

#embed_allowedObject (readonly)

Returns the value of attribute embed_allowed.



345
346
347
# File 'lib/youtube.rb', line 345

def embed_allowed
  @embed_allowed
end

#embed_statusObject (readonly)

Returns the value of attribute embed_status.



344
345
346
# File 'lib/youtube.rb', line 344

def embed_status
  @embed_status
end

#length_secondsObject (readonly)

Returns the value of attribute length_seconds.



332
333
334
# File 'lib/youtube.rb', line 332

def length_seconds
  @length_seconds
end

#rating_avgObject (readonly)

Returns the value of attribute rating_avg.



333
334
335
# File 'lib/youtube.rb', line 333

def rating_avg
  @rating_avg
end

#rating_countObject (readonly)

Returns the value of attribute rating_count.



334
335
336
# File 'lib/youtube.rb', line 334

def rating_count
  @rating_count
end

#recording_countryObject (readonly)

Returns the value of attribute recording_country.



336
337
338
# File 'lib/youtube.rb', line 336

def recording_country
  @recording_country
end

#recording_dateObject (readonly)

Returns the value of attribute recording_date.



337
338
339
# File 'lib/youtube.rb', line 337

def recording_date
  @recording_date
end

#recording_locationObject (readonly)

Returns the value of attribute recording_location.



335
336
337
# File 'lib/youtube.rb', line 335

def recording_location
  @recording_location
end

#tagsObject (readonly)

Returns the value of attribute tags.



338
339
340
# File 'lib/youtube.rb', line 338

def tags
  @tags
end

#thumbnail_urlObject (readonly)

Returns the value of attribute thumbnail_url.



339
340
341
# File 'lib/youtube.rb', line 339

def thumbnail_url
  @thumbnail_url
end

#titleObject (readonly)

Returns the value of attribute title.



340
341
342
# File 'lib/youtube.rb', line 340

def title
  @title
end

#update_timeObject (readonly)

Returns the value of attribute update_time.



341
342
343
# File 'lib/youtube.rb', line 341

def update_time
  @update_time
end

#upload_timeObject (readonly)

Returns the value of attribute upload_time.



342
343
344
# File 'lib/youtube.rb', line 342

def upload_time
  @upload_time
end

#view_countObject (readonly)

Returns the value of attribute view_count.



343
344
345
# File 'lib/youtube.rb', line 343

def view_count
  @view_count
end