Class: LookbookVisualTester::UpdatePreviews
- Defined in:
- lib/lookbook_visual_tester/update_previews.rb
Instance Attribute Summary collapse
-
#changes ⇒ Object
readonly
Returns the value of attribute changes.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(changes) ⇒ UpdatePreviews
constructor
A new instance of UpdatePreviews.
- #update_app_data ⇒ Object
Methods inherited from Service
Constructor Details
#initialize(changes) ⇒ UpdatePreviews
8 9 10 11 |
# File 'lib/lookbook_visual_tester/update_previews.rb', line 8 def initialize(changes) @changes = changes[:modified] @changes_hash = changes end |
Instance Attribute Details
#changes ⇒ Object (readonly)
Returns the value of attribute changes.
6 7 8 |
# File 'lib/lookbook_visual_tester/update_previews.rb', line 6 def changes @changes end |
Instance Method Details
#call ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/lookbook_visual_tester/update_previews.rb', line 18 def call Rails.logger.info "LookbookVisualTester: Processing changes for #{should_process?} #{selected_changes.inspect}, #{changes.inspect}" return unless should_process? process_changes rescue StandardError => e Rails.logger.error "LookbookVisualTester: Error processing changes: #{e.message}" Rails.logger.error e.backtrace.join("\n") end |
#update_app_data ⇒ Object
13 14 15 16 |
# File 'lib/lookbook_visual_tester/update_previews.rb', line 13 def update_app_data LookbookVisualTester.data[:last_changed_files] = changes.presence || [] LookbookVisualTester.data[:last_changed_previews] = previews end |