Class: Cameraman::VideoReference

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ VideoReference

Returns a new instance of VideoReference.



6
7
8
# File 'lib/cameraman/video_reference.rb', line 6

def initialize args
  @item = eval "Cameraman::Sources::#{args[:source]}.new '#{args[:id]}'"
end

Instance Attribute Details

#itemObject

Returns the value of attribute item.



4
5
6
# File 'lib/cameraman/video_reference.rb', line 4

def item
  @item
end

Instance Method Details

#embedObject



14
15
16
# File 'lib/cameraman/video_reference.rb', line 14

def embed
  @item.embed
end

#idObject



22
23
24
# File 'lib/cameraman/video_reference.rb', line 22

def id
  @item.id
end

#original_urlObject



10
11
12
# File 'lib/cameraman/video_reference.rb', line 10

def original_url
  @item.original_url
end

#sourceObject



18
19
20
# File 'lib/cameraman/video_reference.rb', line 18

def source
  @item.class.to_s.split('::').last
end

#to_sObject



26
27
28
# File 'lib/cameraman/video_reference.rb', line 26

def to_s
  '{"id":"'+id+'","source":"'+source+'"}'
end