Module: ActiveEncode::Core

Extended by:
ActiveSupport::Concern
Included in:
Base
Defined in:
lib/active_encode/core.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#cancel!Object


50
51
52
53
54
# File 'lib/active_encode/core.rb', line 50

def cancel!
  run_callbacks :cancel do
    self.class.engine_adapter.cancel self
  end
end

#create!Object


44
45
46
47
48
# File 'lib/active_encode/core.rb', line 44

def create!
  run_callbacks :create do
    self.class.engine_adapter.create self
  end
end

#initialize(input, options = nil) ⇒ Object


39
40
41
42
# File 'lib/active_encode/core.rb', line 39

def initialize(input, options = nil)
  @input = input
  @options = options || self.class.default_options(input)
end

#purge!Object


56
57
58
59
60
# File 'lib/active_encode/core.rb', line 56

def purge!
  run_callbacks :purge do
    self.class.engine_adapter.purge self
  end
end

#reloadObject


66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/active_encode/core.rb', line 66

def reload
  fresh_encode = self.class.engine_adapter.find(id, cast: self.class)
  @id = fresh_encode.id
  @input = fresh_encode.input
  @output = fresh_encode.output
  @state = fresh_encode.state
  @current_operations = fresh_encode.current_operations
  @errors = fresh_encode.errors
  @tech_metadata = fresh_encode.

  self
end

#remove_output!(output_id) ⇒ Object


62
63
64
# File 'lib/active_encode/core.rb', line 62

def remove_output!(output_id)
  self.class.engine_adapter.remove_output self, output_id
end