require "mighty_struct" require_relative "../alma_api" class AlmaApi::Object < MightyStruct def initialize(object) if object.is_a?(Hash) object.each do |_key, _value| if _value.is_a?(String) && _value[/\A\d\d\d\d-\d\d-\d\d\w.*/] object[_key] = Date.parse(_value) end end end super(object) end end