vendor/bundle/ruby/2.3.0/gems/freelancer-0.1.1/lib/freelancer/api/project.rb
# Search for projects using a specified set of criterias.
#
# Valid parameters are:
#   - featured: if only featured projects should be returned
#   - non_public: if only non-public projects should be returned
#   - keyword: the keyword to use for searching
#   - job: a specific job type, or an array of job types, to search for
#   - status: the project status to filter projects by
#   - minimum_budget: the minimum budget to return projects by
#   - maximum_budget: the maximum budget to return projects by
#   - full_time: if only full time projects should be returned
#   - trial: if only trial projects should be returned
#   - gold_members_only: if only gold member only-projects should be returned
#   - duration: the bid end duration for the project (submitdate (default), bid_enddate, id or state)
#   - count: the number of results to return (defaults to 50)
#   - page: the page to retrieve (defaults to 0)
Search for projects using a specified set of criterias.
Search for projects using a specified set of criterias .
def project_search(*args)
          params = extract_params(args)
          params[:job] ||= []
          params[:job] = params[:job].to_a unless params[:job].is_a?(Array)
          [ :featured, :non_public, :full_time, :trial, :gold_members_only ].each do |k|
            params.delete(k) if params.key?(k) && params[k] == false
          end
          result = api_get("/Project/searchProjects.json", build_api_params({
            :isfeatured => params[:featured],
            :isnonpublic => params[:non_public],
            :searchkeyword => params[:keyword],
            :searchjobtypecsv => params[:job].join(","),
            :status => params[:status],
            :budgetmin => params[:minimum_budget],
            :budgetmax => params[:maximum_budget],
            :isfulltime => params[:full_time],
            :istrial => params[:trial],
            :isgoldmembersonly => params[:gold_members_only],
            :bidendsduration => params[:duration],
            :count => params[:count],
            :page => params[:page]
          }))
          ::Freelancer::Models::Project.parse_collection(result, :shift => [ :"json-result", :items ])
        end
def project_search ( * args ) params = extract_params ( args ) params [ :job ] ||= [ ] params [ :job ] = params [ :job ] . to_a unless params [ :job ] . is_a? ( Array ) [ :featured , :non_public , :full_time , :trial , :gold_members_only ] . each do | k | params . delete ( k ) if params . key? ( k ) && params [ k ] == false end result = api_get ( "/Project/searchProjects.json" , build_api_params ( { :isfeatured => params [ :featured ] , :isnonpublic => params [ :non_public ] , :searchkeyword => params [ :keyword ] , :searchjobtypecsv => params [ :job ] . join ( "," ) , :status => params [ :status ] , :budgetmin => params [ :minimum_budget ] , :budgetmax => params [ :maximum_budget ] , :isfulltime => params [ :full_time ] , :istrial => params [ :trial ] , :isgoldmembersonly => params [ :gold_members_only ] , :bidendsduration => params [ :duration ] , :count => params [ :count ] , :page => params [ :page ] } ) ) :: Freelancer :: Models :: Project . parse_collection ( result , :shift => [ :" json-result " , :items ] ) end
Search for projects using a specified set of criterias.
Search for projects using a specified set of criterias .
# Handle the job attribute, make sure it's an array and not set to nil to # simplify the handling below. # Delete some boolean data from the params if the values are set to fault, # since that's the default already # Execute the service call # Parse and return the response
args
<not_specific>