Class: Tangerine::Video
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
-
#description ⇒ Object
Returns the value of attribute description.
-
#embed_code ⇒ Object
Returns the value of attribute embed_code.
-
#flight_start_time ⇒ Object
Returns the value of attribute flight_start_time.
-
#height ⇒ Object
Returns the value of attribute height.
-
#labels ⇒ Object
Returns the value of attribute labels.
-
#length ⇒ Object
Returns the value of attribute length.
-
#metadata ⇒ Object
Returns the value of attribute metadata.
-
#size ⇒ Object
Returns the value of attribute size.
-
#stat ⇒ Object
Returns the value of attribute stat.
-
#status ⇒ Object
Returns the value of attribute status.
-
#thumbnail ⇒ Object
Returns the value of attribute thumbnail.
-
#title ⇒ Object
Returns the value of attribute title.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
-
#uploaded_at ⇒ Object
Returns the value of attribute uploaded_at.
-
#width ⇒ Object
Returns the value of attribute width.
Class Method Summary collapse
Instance Method Summary collapse
- #as_json(options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ Video
constructor
end.
- #player(options = {}) ⇒ Object
Methods inherited from Base
all, find, finder, prepare_items
Constructor Details
#initialize(options = {}) ⇒ Video
end
28 29 30 31 32 33 34 35 36 |
# File 'lib/tangerine/backlot/video.rb', line 28 def initialize(={}) @options = add_labels .delete('metadata') .delete('labels') super() end |
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content.
3 4 5 |
# File 'lib/tangerine/backlot/video.rb', line 3 def content @content end |
#description ⇒ Object
Returns the value of attribute description.
3 4 5 |
# File 'lib/tangerine/backlot/video.rb', line 3 def description @description end |
#embed_code ⇒ Object
Returns the value of attribute embed_code.
3 4 5 |
# File 'lib/tangerine/backlot/video.rb', line 3 def @embed_code end |
#flight_start_time ⇒ Object
Returns the value of attribute flight_start_time.
3 4 5 |
# File 'lib/tangerine/backlot/video.rb', line 3 def flight_start_time @flight_start_time end |
#height ⇒ Object
Returns the value of attribute height.
3 4 5 |
# File 'lib/tangerine/backlot/video.rb', line 3 def height @height end |
#labels ⇒ Object
Returns the value of attribute labels.
3 4 5 |
# File 'lib/tangerine/backlot/video.rb', line 3 def labels @labels end |
#length ⇒ Object
Returns the value of attribute length.
3 4 5 |
# File 'lib/tangerine/backlot/video.rb', line 3 def length @length end |
#metadata ⇒ Object
Returns the value of attribute metadata.
3 4 5 |
# File 'lib/tangerine/backlot/video.rb', line 3 def @metadata end |
#size ⇒ Object
Returns the value of attribute size.
3 4 5 |
# File 'lib/tangerine/backlot/video.rb', line 3 def size @size end |
#stat ⇒ Object
Returns the value of attribute stat.
3 4 5 |
# File 'lib/tangerine/backlot/video.rb', line 3 def stat @stat end |
#status ⇒ Object
Returns the value of attribute status.
3 4 5 |
# File 'lib/tangerine/backlot/video.rb', line 3 def status @status end |
#thumbnail ⇒ Object
Returns the value of attribute thumbnail.
3 4 5 |
# File 'lib/tangerine/backlot/video.rb', line 3 def thumbnail @thumbnail end |
#title ⇒ Object
Returns the value of attribute title.
3 4 5 |
# File 'lib/tangerine/backlot/video.rb', line 3 def title @title end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
3 4 5 |
# File 'lib/tangerine/backlot/video.rb', line 3 def updated_at @updated_at end |
#uploaded_at ⇒ Object
Returns the value of attribute uploaded_at.
3 4 5 |
# File 'lib/tangerine/backlot/video.rb', line 3 def uploaded_at @uploaded_at end |
#width ⇒ Object
Returns the value of attribute width.
3 4 5 |
# File 'lib/tangerine/backlot/video.rb', line 3 def width @width end |
Class Method Details
.order_videos!(videos, embed_codes) ⇒ Object
56 57 58 59 60 61 62 |
# File 'lib/tangerine/backlot/video.rb', line 56 def self.order_videos!(videos, ) ordered = [] .each do |code| ordered << videos.select { |video| video. == code } end ordered.flatten end |
.where(options) ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/tangerine/backlot/video.rb', line 43 def self.where() # FYI # Adding 'status' => 'live' to the query string does not work! = [:embed_code].join(',') result = Tangerine.query('embedCode' => , 'fields' => 'labels,metadata') items = result.parsed_response['list']['item'] items = Tangerine::Base.prepare_items(items) videos = items.collect { |item| Tangerine::Video.new(item) } videos = videos.reject { |video| video.status != 'live' } Tangerine::Video.order_videos!(videos, [:embed_code]) end |
Instance Method Details
#as_json(options = {}) ⇒ Object
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/tangerine/backlot/video.rb', line 64 def as_json( = {}) {:size => size, :title => title, :thumbnail => thumbnail, :content => content, :updated_at => updated_at, :embed_code => , :description => description, :length => length, :status => status, :uploaded_at => uploaded_at, :flight_start_time => flight_start_time, :width => width, :height => height, :labels => labels, :metadata => , :stat => stat } end |