Created
August 4, 2009 22:27
-
-
Save thoughtbot/162319 to your computer and use it in GitHub Desktop.
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 Article < ActiveRecord::Base | |
| after_create :submit_to_crossref | |
| private | |
| def submit_to_crossref | |
| CrossrefRequest.new(:title => title, | |
| # other info for the request | |
| :author => author).submit | |
| end | |
| end | |
| class CrossrefRequest | |
| def initialize(attributes) | |
| # set attributes | |
| end | |
| def submit | |
| # call helpers to format and submit the request | |
| end | |
| private | |
| # helper methods related to formatting/submission | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment