Skip to content

Commit

Permalink
added space and _
Browse files Browse the repository at this point in the history
  • Loading branch information
kjgarza committed Dec 31, 2019
1 parent 5f68b9d commit 2463506
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions app/graphql/types/person_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,46 +29,46 @@ def type
"Person"
end

def datasets(**args)
def datasets(**_args)
ids = Event.query(nil, obj_id: https_to_http(object[:id]), citation_type: "Dataset-Person").results.to_a.map do |e|
doi_from_url(e.subj_id)
end
ElasticsearchLoader.for(Doi).load_many(ids)
end

def publications(**args)
def publications(**_args)
ids = Event.query(nil, obj_id: https_to_http(object[:id]), citation_type: "Person-ScholarlyArticle").results.to_a.map do |e|
doi_from_url(e.subj_id)
end
ElasticsearchLoader.for(Doi).load_many(ids)
end

def software_source_codes(**args)
def software_source_codes(**_args)
ids = Event.query(nil, obj_id: https_to_http(object[:id]), citation_type: "Person-SoftwareSourceCode").results.to_a.map do |e|
doi_from_url(e.subj_id)
end
ElasticsearchLoader.for(Doi).load_many(ids)
end

def citation_count(**args)
def citation_count(**_args)
dois = Event.query(nil, obj_id: https_to_http(object[:id])).results.to_a.map do |e|
doi_from_url(e.subj_id)
end
EventsQuery.new.citations(dois).sum {|h| h[:count] }
EventsQuery.new.citations(dois).sum { |h| h[:count] }
end

def view_count(**args)
def view_count(**_args)
dois = Event.query(nil, obj_id: https_to_http(object[:id])).results.to_a.map do |e|
doi_from_url(e.subj_id)
end
EventsQuery.new.views(dois).sum {|h| h[:count] }
EventsQuery.new.views(dois).sum { |h| h[:count] }
end

def download_count(**args)
def download_count(**_args)
dois = Event.query(nil, obj_id: https_to_http(object[:id])).results.to_a.map do |e|
doi_from_url(e.subj_id)
end
EventsQuery.new.downloads(dois).sum {|h| h[:count] }
EventsQuery.new.downloads(dois).sum { |h| h[:count] }
end

def https_to_http(url)
Expand Down

0 comments on commit 2463506

Please sign in to comment.