-
Notifications
You must be signed in to change notification settings - Fork 229
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change Virtus::InstanceMethods#initialize to not create an empty hash…
… by default * When no arguments are passed in, the end result is the same as when a nil is passed in, so there's no need to create an empty Hash and then "set" the internal state with it. Better to just default to nil, and short-circuit the call. * Added specs so that if anything other than nil or an object that responds to #to_hash is passed in an exception is raised. Like DM1, by default I *only* want constructors handling Hash-like objects or nil; anything else passed in should be considered an exceptional case.
- Loading branch information
Showing
2 changed files
with
24 additions
and
14 deletions.
There are no files selected for viewing
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
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