Skip to content

Instantly share code, notes, and snippets.

@krisleech
Created January 14, 2015 11:16
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 krisleech/1ba4e1210612f235fbce to your computer and use it in GitHub Desktop.
Save krisleech/1ba4e1210612f235fbce to your computer and use it in GitHub Desktop.
Presenter name
# given these models
class Study < AR::Base
class Site < AR::Base
class Visit < AR::Base
end
end
end
Study::Site::Visit
# How name a VisitPresenter?
# nested inside models
class Study
class Site
class VisitPresenter
end
end
end
Study::Site::VisitPresenter.new
# ^ I dislike this because we will need to require the model from the presenter
# nested inside presenters
class StudyPresenter
class SitePresenter
class VisitPresenter
end
end
end
StudyPresenter::SitePresenter::VisitPresenter.new
# pluralized namespaces
module Studies
module Sites
class VisitPresenter
end
end
end
Studies::Sites::VisitPresenter
# nested inside namespace
module Presenters
class Study
class Site
class Visit
end
end
end
end
Presenters::Study::Site::Visit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment