Skip to content

Overriding initialize #1

@rstacruz

Description

@rstacruz

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions