Class: Tangerine::Channel
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#embed_code ⇒ Object
Returns the value of attribute embed_code.
-
#length ⇒ Object
Returns the value of attribute length.
-
#size ⇒ Object
Returns the value of attribute size.
-
#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.
Instance Method Summary collapse
Methods inherited from Base
all, find, finder, #initialize, prepare_items
Constructor Details
This class inherits a constructor from Tangerine::Base
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
3 4 5 |
# File 'lib/tangerine/backlot/channel.rb', line 3 def description @description end |
#embed_code ⇒ Object
Returns the value of attribute embed_code.
3 4 5 |
# File 'lib/tangerine/backlot/channel.rb', line 3 def @embed_code end |
#length ⇒ Object
Returns the value of attribute length.
3 4 5 |
# File 'lib/tangerine/backlot/channel.rb', line 3 def length @length end |
#size ⇒ Object
Returns the value of attribute size.
3 4 5 |
# File 'lib/tangerine/backlot/channel.rb', line 3 def size @size end |
#status ⇒ Object
Returns the value of attribute status.
3 4 5 |
# File 'lib/tangerine/backlot/channel.rb', line 3 def status @status end |
#thumbnail ⇒ Object
Returns the value of attribute thumbnail.
3 4 5 |
# File 'lib/tangerine/backlot/channel.rb', line 3 def thumbnail @thumbnail end |
#title ⇒ Object
Returns the value of attribute title.
3 4 5 |
# File 'lib/tangerine/backlot/channel.rb', line 3 def title @title end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
3 4 5 |
# File 'lib/tangerine/backlot/channel.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/channel.rb', line 3 def uploaded_at @uploaded_at end |
Instance Method Details
#as_json(options = {}) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/tangerine/backlot/channel.rb', line 25 def as_json( = {}) # TODO: Figure out why rails needs this to be called so badly vids = videos {:size => size, :title => title, :thumbnail => thumbnail, :updated_at => updated_at, :embed_code => , :description => description, :length => length, :status => status, :uploaded_at => uploaded_at, :videos => vids } end |
#videos ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/tangerine/backlot/channel.rb', line 17 def videos channel = Tangerine::Backlot::API.get('/channels', 'mode' => 'list', 'channelEmbedCode' => ) items = channel.parsed_response['channel']['item'] items = Tangerine::Base.prepare_items(items) = items.collect { |item| item['embedCode'] } Tangerine::Video.where(:embed_code => ) end |