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
Returns a new instance of UpdatePreviews.
7 8 9 10 |
# File 'lib/lookbook_visual_tester/update_previews.rb', line 7 def initialize(changes) @changes = changes[:modified] @changes_hash = changes end |
Instance Attribute Details
#changes ⇒ Object (readonly)
Returns the value of attribute changes.
5 6 7 |
# File 'lib/lookbook_visual_tester/update_previews.rb', line 5 def changes @changes end |
Instance Method Details
#call ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/lookbook_visual_tester/update_previews.rb', line 17 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.}" Rails.logger.error e.backtrace.join("\n") end |
#update_app_data ⇒ Object
12 13 14 15 |
# File 'lib/lookbook_visual_tester/update_previews.rb', line 12 def update_app_data LookbookVisualTester.data[:last_changed_files] = changes.presence || [] LookbookVisualTester.data[:last_changed_previews] = selected_previews end |