e4d81151f4841a6354d043551a970418b32be02aEugen Kuksamodule Hets
e4d81151f4841a6354d043551a970418b32be02aEugen Kuksa class ActionCaller < Caller
2f305d7bc01ae84f6b219b562fe4d31392abc1d6Eugen Kuksa attr_accessor :hets_options
e4d81151f4841a6354d043551a970418b32be02aEugen Kuksa
2f305d7bc01ae84f6b219b562fe4d31392abc1d6Eugen Kuksa def initialize(hets_instance, hets_options)
2f305d7bc01ae84f6b219b562fe4d31392abc1d6Eugen Kuksa self.hets_options = hets_options
e4d81151f4841a6354d043551a970418b32be02aEugen Kuksa msg = "<#{hets_instance}> not up."
e4d81151f4841a6354d043551a970418b32be02aEugen Kuksa raise Hets::InactiveInstanceError, msg unless hets_instance.try(:up?)
e4d81151f4841a6354d043551a970418b32be02aEugen Kuksa super(hets_instance)
e4d81151f4841a6354d043551a970418b32be02aEugen Kuksa end
e4d81151f4841a6354d043551a970418b32be02aEugen Kuksa
e4d81151f4841a6354d043551a970418b32be02aEugen Kuksa def build_query_string
2f305d7bc01ae84f6b219b562fe4d31392abc1d6Eugen Kuksa hets_options.options
e4d81151f4841a6354d043551a970418b32be02aEugen Kuksa end
e4d81151f4841a6354d043551a970418b32be02aEugen Kuksa
e4d81151f4841a6354d043551a970418b32be02aEugen Kuksa def handle_possible_hets_error(error)
e4d81151f4841a6354d043551a970418b32be02aEugen Kuksa HetsErrorProcess.new(error).handle
e4d81151f4841a6354d043551a970418b32be02aEugen Kuksa rescue Hets::NotAHetsError
e4d81151f4841a6354d043551a970418b32be02aEugen Kuksa raise error
e4d81151f4841a6354d043551a970418b32be02aEugen Kuksa end
e4d81151f4841a6354d043551a970418b32be02aEugen Kuksa end
e4d81151f4841a6354d043551a970418b32be02aEugen Kuksaend