Skip to content

Instantly share code, notes, and snippets.

@jeremyf
Created November 6, 2014 22:20
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 jeremyf/4ac46163af876673e5a7 to your computer and use it in GitHub Desktop.
Save jeremyf/4ac46163af876673e5a7 to your computer and use it in GitHub Desktop.
Rudimentary prototype of the proposed Hydra::Works.
# Rudimentary prototype of the proposed Hydra::Works.
#
# The idea is to use modules to define the interface of our data-structures.
# This is following the [Lotus Philosophy](https://github.com/lotus/docs/blob/master/philosophy.md)
module Hydra::Works
module Work
def initialize
@files = []
@members = []
end
def files
@files
end
def members
@members
end
end
module File
def initialize(container)
@container = container
end
def container
@container
end
end
end
class Work
include Hydra::Works::Work
end
class File
include Hydra::Works::File
end
@jeremyf
Copy link
Author

jeremyf commented Nov 7, 2014

  • Work contains File
  • AdminSet contains File
  • File can only be contained by 1 object

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment