This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApplicationController | |
# Sharing the setup of processors, since many actions will use them | |
# - thinking of switching this out for a facade | |
def trigger_processor(name, listening_controller) | |
processor_klass = processors[name] | |
processor = processor_klass.new(params) | |
processor.add_listener(EventNotifier.new) | |
processor.add_listener(listening_controller) | |
processor.process(current_user) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I've been playing with the idea of combining the data array defined in application/collection+json | |
(http://amundsen.com/media-types/collection/format/) with hal links for templated data. | |
Seems like a good way to keep the media type lightweight while allowing the api to specify the fields | |
it would like passed to a given resource. | |
I haven't really given much thought to an xml variation, but I took a stab at it as well. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Comparison | |
include DataMapper::Resource | |
property :id, Serial | |
has n, :msruns, :through => Resource | |
has n, :secondary_msruns, "Msrun", :through => SecondaryMsrunComparison, :via => :msrun | |
belongs_to :metric | |
end | |
class Msrun |