Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overriding initialize #1

Open
rstacruz opened this issue Feb 8, 2012 · 0 comments
Open

Overriding initialize #1

rstacruz opened this issue Feb 8, 2012 · 0 comments

Comments

@rstacruz
Copy link

rstacruz commented Feb 8, 2012

Is there a way to subclass Hashr and provide your own initialize method? Perhaps to do validation like so:

class Config < Hashr
  def initialize(options)
    super options
    raise ConfigError, "output is not defined"  unless output?
  end
end

...or for whatever other reason the user would want to subclass Hashr. This example doesn't work properly right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant