Module: ActiveEncode::Core
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
- #cancel! ⇒ Object
- #create! ⇒ Object
- #created? ⇒ Boolean
- #initialize(input_url, options = nil) ⇒ Object
- #purge! ⇒ Object
- #reload ⇒ Object
- #remove_output!(output_id) ⇒ Object
- #tech_metadata ⇒ Object deprecated Deprecated.
Instance Method Details
#cancel! ⇒ Object
66 67 68 69 70 |
# File 'lib/active_encode/core.rb', line 66 def cancel! run_callbacks :cancel do merge!(self.class.engine_adapter.cancel(self.id)) end end |
#create! ⇒ Object
59 60 61 62 63 64 |
# File 'lib/active_encode/core.rb', line 59 def create! # TODO: Raise ArgumentError if self has an id? run_callbacks :create do merge!(self.class.engine_adapter.create(self.input.url, self.)) end end |
#created? ⇒ Boolean
90 91 92 |
# File 'lib/active_encode/core.rb', line 90 def created? !id.nil? end |
#initialize(input_url, options = nil) ⇒ Object
54 55 56 57 |
# File 'lib/active_encode/core.rb', line 54 def initialize(input_url, = nil) @input = Input.new.tap{ |input| input.url = input_url } @options = || self.class.(input_url) end |
#purge! ⇒ Object
72 73 74 75 76 77 |
# File 'lib/active_encode/core.rb', line 72 def purge! ActiveSupport::Deprecation.warn("#purge! will be removed without replacement in ActiveEncode 0.3") run_callbacks :purge do self.class.engine_adapter.purge self end end |
#reload ⇒ Object
84 85 86 87 88 |
# File 'lib/active_encode/core.rb', line 84 def reload run_callbacks :reload do merge!(self.class.engine_adapter.find(id)) end end |
#remove_output!(output_id) ⇒ Object
79 80 81 82 |
# File 'lib/active_encode/core.rb', line 79 def remove_output!(output_id) ActiveSupport::Deprecation.warn("#remove_output will be removed without replacement in ActiveEncode 0.3") self.class.engine_adapter.remove_output self, output_id end |
#tech_metadata ⇒ Object
Deprecated.
95 96 97 98 99 100 101 |
# File 'lib/active_encode/core.rb', line 95 def = {} [:width, :height, :frame_rate, :duration, :file_size, :audio_codec, :video_codec, :audio_bitrate, :video_bitrate, :checksum].each do |key| [key] = input.send(key) end end |