Class: VzaarApi::Strategy::Video::Create
- Inherits:
-
Object
- Object
- VzaarApi::Strategy::Video::Create
- Defined in:
- lib/vzaar_api/strategy/video/create.rb
Instance Attribute Summary collapse
-
#attrs ⇒ Object
readonly
Returns the value of attribute attrs.
-
#video_class ⇒ Object
readonly
Returns the value of attribute video_class.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(attrs, video_class) ⇒ Create
constructor
A new instance of Create.
Constructor Details
#initialize(attrs, video_class) ⇒ Create
8 9 10 11 |
# File 'lib/vzaar_api/strategy/video/create.rb', line 8 def initialize(attrs, video_class) @attrs = attrs @video_class = video_class end |
Instance Attribute Details
#attrs ⇒ Object (readonly)
Returns the value of attribute attrs.
6 7 8 |
# File 'lib/vzaar_api/strategy/video/create.rb', line 6 def attrs @attrs end |
#video_class ⇒ Object (readonly)
Returns the value of attribute video_class.
6 7 8 |
# File 'lib/vzaar_api/strategy/video/create.rb', line 6 def video_class @video_class end |
Instance Method Details
#execute ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/vzaar_api/strategy/video/create.rb', line 13 def execute case when attrs.has_key?(:guid) create_from_guid when attrs.has_key?(:path) create_from_path when attrs.has_key?(:url) create_from_url else raise Error.new('Invalid parameters: Expected one of :guid, :path, :url') end end |