Class: Video

Inherits:
Transit::Context show all
Defined in:
app/models/contexts/video.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Transit::Context

#ensure_context_position_value, #field_name, #file_ext, #package_type, #shortname, #to_backbone

Class Method Details

.sourcesObject



4
5
6
# File 'app/models/contexts/video.rb', line 4

def self.sources
  ['URL', 'Uploaded Video', 'YouTube', 'Vimeo', 'Ted'].collect{ |src| [src, src.underscore ] }
end

Instance Method Details

#media_context?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'app/models/contexts/video.rb', line 16

def media_context?
  true
end

#to_js(attrs = {}) ⇒ Object



20
21
22
# File 'app/models/contexts/video.rb', line 20

def to_js( attrs = {} )
  super({ source: source, type: video_type, ext: file_ext }.reverse_merge!(attrs))
end

#video_typeObject



12
13
14
# File 'app/models/contexts/video.rb', line 12

def video_type
  self.meta['video_type']
end

#video_type=(t) ⇒ Object



8
9
10
# File 'app/models/contexts/video.rb', line 8

def video_type=(t)
  self.meta['video_type'] = t
end