Skip to content

Instantly share code, notes, and snippets.

@jayniz
Created February 13, 2012 10:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jayniz/1816026 to your computer and use it in GitHub Desktop.
Save jayniz/1816026 to your computer and use it in GitHub Desktop.
class Jogger
module NamedTraversals
# Traverse to somebody's woman friends
def self.friends(current_traversal, gender)
t = current_traversal.in(:friends)
t = t.filter(gender: gender)
end
# Group and sort
def self.top_list(current_traversal, type)
t = current_traversal.out(type)
t = t.filter(type: 'Movie')
t = t.group_count{ |v| v }
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment