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



52
53
54
55
56
# File 'lib/active_encode/core.rb', line 52

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

#create!Object



46
47
48
49
50
# File 'lib/active_encode/core.rb', line 46

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

#initialize(input, options = nil) ⇒ Object



41
42
43
44
# File 'lib/active_encode/core.rb', line 41

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

#purge!Object



58
59
60
61
62
# File 'lib/active_encode/core.rb', line 58

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

#reloadObject



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

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



64
65
66
# File 'lib/active_encode/core.rb', line 64

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