-
Notifications
You must be signed in to change notification settings - Fork 151
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
Add setting for Registration::Object default prefix #105
Conversation
ValueObjects::Prefix used in the #initializer
In principle I'm happy with this, thanks 😄 I'll take a closer look as soon as possible. There is one failure on ruby-head. Would you take a look please? |
The specs became non-mutating the Prefix.default value.
D'oh! This was due to inaccurate insulation of my specs from each other. |
Instances of Wisper::ValueObject::Events quack like arrays in respond to #include?(event).
And one more little thing. I've noticed the list of events can be set as "strict" String, Symbol, Array, For example, when I use not a String, but its subling, I raise ArgumentError: Event = Class.new(String)
event = Event.new "foo"
event.is_a? String # => true
event # => "foo"
BlockRegistration.broadcast event, #...
# => ArgumentError "Event not supported for `on` argument" This is because And once again, before solving the problem I've isolated Events as a I didn't figure out yet how to made my change But IMHO the extraction makes Wisper::Registration more readable and testable, |
2 similar comments
I've not forgot about this. |
Add setting for Registration::Object default prefix
Thanks and sorry for the delay! |
Does this need something adding to the README? Thanks. |
Hi, Kris!
I've tried to add configuration setting to Wisper::Configuration to make
it possible changing default prefix of Registration::Object.
To prevent the Object class from messing by the default setter, I've extracted
the Prefix as value object. Then I've added a method to the Configuration,
because it seems the better solution, than accessing the internal class directly.
I've split changes to 3 commits for every single step of my refactoring.
I didn't discussed it in advance, 'cause it turned out to be fast and simple.
If you find it appropriate, please accept the commits.