Class: VzaarApi::Strategy::Subtitle::Create
- Inherits:
-
Object
- Object
- VzaarApi::Strategy::Subtitle::Create
- Defined in:
- lib/vzaar_api/strategy/subtitle/create.rb
Instance Attribute Summary collapse
-
#attrs ⇒ Object
readonly
Returns the value of attribute attrs.
-
#klass ⇒ Object
readonly
Returns the value of attribute klass.
-
#video_id ⇒ Object
readonly
Returns the value of attribute video_id.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(video_id, attrs, klass) ⇒ Create
constructor
A new instance of Create.
Constructor Details
#initialize(video_id, attrs, klass) ⇒ Create
Returns a new instance of Create.
7 8 9 10 11 |
# File 'lib/vzaar_api/strategy/subtitle/create.rb', line 7 def initialize(video_id, attrs, klass) @attrs = attrs @video_id = video_id @klass = klass end |
Instance Attribute Details
#attrs ⇒ Object (readonly)
Returns the value of attribute attrs.
5 6 7 |
# File 'lib/vzaar_api/strategy/subtitle/create.rb', line 5 def attrs @attrs end |
#klass ⇒ Object (readonly)
Returns the value of attribute klass.
5 6 7 |
# File 'lib/vzaar_api/strategy/subtitle/create.rb', line 5 def klass @klass end |
#video_id ⇒ Object (readonly)
Returns the value of attribute video_id.
5 6 7 |
# File 'lib/vzaar_api/strategy/subtitle/create.rb', line 5 def video_id @video_id end |
Instance Method Details
#execute ⇒ Object
13 14 15 16 |
# File 'lib/vzaar_api/strategy/subtitle/create.rb', line 13 def execute res = attrs[:file] ? create_from_file : Lib::Api.new.post(url, attrs) klass.new res.data.merge(scope_id: video_id) end |