Overriding initialize #1

rstacruz opened this Issue Feb 8, 2012 · 0 comments


None yet

1 participant

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?

...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