Created
May 8, 2012 19:05
-
-
Save mcfiredrill/2638540 to your computer and use it in GitHub Desktop.
class variables
This file contains 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 FooJob < JobBase | |
@@model_name = Foo | |
end |
This file contains 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 JobBase | |
attr_reader :model_name, :model_id, :job | |
def initialize(model_id) | |
@model_id = model_id | |
@job = @@model_name.find(@model_id).job | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment