Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix warning related to content_tempfile #286

Merged
merged 1 commit into from
Sep 14, 2024
Merged

Conversation

tagliala
Copy link
Member

@tagliala tagliala commented Sep 14, 2024

This commit improves the Heathen::Job class by implementing lazy
initialization for the @content_tempfile instance variable.

The changes:

  1. Remove explicit nil initialization in the constructor
  2. Introduce a private attr_reader for content_tempfile
  3. Replace direct @content_tempfile access with the new reader method

These modifications address the following issues:

  • Eliminate uninitialized instance variable warning
  • Improve encapsulation by making content_tempfile private
  • Enhance code clarity and maintainability

The behavior of the class remains unchanged, ensuring backwards
compatibility while improving its internal structure.

This commit improves the `Heathen::Job` class by implementing lazy 
initialization for the `@content_tempfile` instance variable.

The changes:
1. Remove explicit `nil` initialization in the constructor
2. Introduce a private `attr_reader` for `content_tempfile`
3. Replace direct `@content_tempfile` access with the new reader method

These modifications address the following issues:
- Eliminate uninitialized instance variable warning
- Improve encapsulation by making `content_tempfile` private
- Enhance code clarity and maintainability

The behavior of the class remains unchanged, ensuring backwards 
compatibility while improving its internal structure.
@tagliala tagliala merged commit 0fdaa43 into master Sep 14, 2024
2 checks passed
@tagliala tagliala deleted the chore/improve-tempfile branch September 14, 2024 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant