Class: Pageflow::Panorama::JobStatusAttributes

Inherits:
Struct
  • Object
show all
Defined in:
lib/pageflow/panorama/job_status_attributes.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#recordObject

Returns the value of attribute record

Returns:

  • (Object)

    the current value of record



3
4
5
# File 'lib/pageflow/panorama/job_status_attributes.rb', line 3

def record
  @record
end

#stage_nameObject

Returns the value of attribute stage_name

Returns:

  • (Object)

    the current value of stage_name



3
4
5
# File 'lib/pageflow/panorama/job_status_attributes.rb', line 3

def stage_name
  @stage_name
end

Class Method Details

.handle(record, options = {}, &block) ⇒ Object



4
5
6
# File 'lib/pageflow/panorama/job_status_attributes.rb', line 4

def self.handle(record, options = {}, &block)
  new(record, options[:stage]).call(&block)
end

.reset(record, options = {}) ⇒ Object



8
9
10
# File 'lib/pageflow/panorama/job_status_attributes.rb', line 8

def self.reset(record, options = {})
  new(record, options[:stage]).reset
end

Instance Method Details

#call(&block) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'lib/pageflow/panorama/job_status_attributes.rb', line 12

def call(&block)
  update_progress(0)

  with_error_message_handling do
    block.call do |percent|
      update_progress(percent)
    end
  end
end

#resetObject



22
23
24
# File 'lib/pageflow/panorama/job_status_attributes.rb', line 22

def reset
  update_progress(0)
end