#encoding: UTF-8 module PlataformaSocial module Support protected def post_request path, params = {} klass = self.class.methods(false).include?(:socialp_route) ? self.class : self.class.superclass PlataformaSocial::Request.post "#{klass.socialp_route}/#{path}", params end def get_request path, params = {} klass = self.class.methods(false).include?(:socialp_route) ? self.class : self.class.superclass PlataformaSocial::Request.get "#{klass.socialp_route}/#{path}", params end def verify_if_has_all_required_parameters required_parameters, options required_parameters.each do |parameter| if parameter.is_a?(Hash) raise "Quando temos o parâmetro #{parameter.keys.first}, temos que ter obrigatóriamente o parâmetro #{parameter.values.first}" if options[parameter.keys.first.to_sym].present? && options[parameter.keys.first.to_sym] != false && options[parameter.values.first.to_sym].nil? else raise "Faltando o parâmetro: #{parameter}" if options[parameter.to_sym].nil? end end end end end