lib/eco/api/session/config/apis/one_off.rb in eco-helpers-3.0.19 vs lib/eco/api/session/config/apis/one_off.rb in eco-helpers-3.0.20

- old
+ new

@@ -2,18 +2,18 @@ module API class Session class Config class Apis module OneOff - private - def one_off? - @is_one_off ||= + @is_one_off ||= # rubocop:disable Naming/MemoizedInstanceVariableName SCR.get_arg('-api-key') || SCR.get_arg('-one-off') end + private + def one_off_key return @one_off_key if instance_variable_defined?(:@one_off_key) return unless one_off? @@ -46,14 +46,14 @@ def one_off_org return @one_off_org if instance_variable_defined?(:@one_off_org) msg = "You should specify -org NAME when using -api-key or -one-off" - raise msg unless org = SCR.get_arg('-org', with_param: true) + raise msg unless (org = SCR.get_arg('-org', with_param: true)) str_org = "#{org.downcase.split(/[^a-z]+/).join('_')}_#{one_off_enviro.gsub('.', '_')}" - @one_off_org ||= str_org.to_sym + @one_off_org ||= str_org.to_sym end def one_off_enviro return @one_off_enviro if instance_variable_defined?(:@one_off_enviro) @@ -81,10 +81,10 @@ fd << "#{var}=#{value}" unless found end true rescue StandardError => err - puts "#{err}" + puts err.to_s false end end end end