lib/eco/api/common/loaders/base.rb in eco-helpers-2.6.4 vs lib/eco/api/common/loaders/base.rb in eco-helpers-2.7.0
- old
+ new
@@ -12,11 +12,11 @@
created_at <=> other.created_at
end
# If still not set, it sets the `created_at` class timestamp.
def set_created_at!
- @created_at = Time.now unless @created_at
+ @created_at ||= Time.now unless @created_at # rubocop:disable Naming/MemoizedInstanceVariableName
end
# Class creation timestamp, to be able to load them in the order they were declared.
def created_at
@created_at ||= Time.now
@@ -31,10 +31,10 @@
end
private
def simulate?
- options.dig(:simulate) || options.dig(:dry_run)
+ options[:simulate] || options[:dry_run]
end
alias_method :dry_run?, :simulate?
def session
@session ||= ASSETS.session