Class: Cameraman::VideoReference
- Inherits:
-
Object
- Object
- Cameraman::VideoReference
- Defined in:
- lib/cameraman/video_reference.rb
Instance Attribute Summary collapse
-
#item ⇒ Object
Returns the value of attribute item.
Instance Method Summary collapse
- #embed ⇒ Object
- #id ⇒ Object
-
#initialize(args) ⇒ VideoReference
constructor
A new instance of VideoReference.
- #original_url ⇒ Object
- #source ⇒ Object
- #to_s ⇒ Object
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
#item ⇒ Object
Returns the value of attribute item.
4 5 6 |
# File 'lib/cameraman/video_reference.rb', line 4 def item @item end |
Instance Method Details
#embed ⇒ Object
14 15 16 |
# File 'lib/cameraman/video_reference.rb', line 14 def @item. end |
#id ⇒ Object
22 23 24 |
# File 'lib/cameraman/video_reference.rb', line 22 def id @item.id end |
#original_url ⇒ Object
10 11 12 |
# File 'lib/cameraman/video_reference.rb', line 10 def original_url @item.original_url end |
#source ⇒ Object
18 19 20 |
# File 'lib/cameraman/video_reference.rb', line 18 def source @item.class.to_s.split('::').last end |
#to_s ⇒ Object
26 27 28 |
# File 'lib/cameraman/video_reference.rb', line 26 def to_s '{"id":"'+id+'","source":"'+source+'"}' end |