Closed roback closed 8 years ago
setter= documentation is hidden if used with attr_accessor or attr_reader
so if we remove our attr_reader
s it wont be hidden?
so if we remove our attr_readers it wont be hidden?
yes, first thing mentioned in the issue, sorry :)
IMHO we want to the documentation to not be hidden, not using two attr_reader
s seems like a small tradeoff we can handle
IMHO we want to the documentation to not be hidden, not using two attr_readers seems like a small tradeoff we can handle
I agree, I haven't tested the things suggested in the issue yet, but I'll do that.
I think we are happy now :) Good work!
Nice!
Im not sure if this is a breaking change or not. It is a breaking change for the users that (wrongly?) used the client with non-UTC times, as they will receive another result when making a query now. The users that converts to UTC themselves will still get the same result back from the api now, as they did before.
It is a breaking change for the start_time
and end_time
getters though.
I think we could call it a bug-fix actually, so bumping the last digit is fine for me.
It is a breaking change for the start_time and end_time getters though.
Ah, true.
It is a breaking change for the start_time and end_time getters though.
That they now always return the time in UTC?
That they now always return the time in UTC?
Yes
Let's :shipit:?
Yes!
It is a breaking change for the start_time and end_time getters though.
Agree, I think the breaking change is the to_time
though, if you pass in an object and then want to compare with #end_time
or #start_time
it will fail since the getter might return another object than the setter received.
[7] pry(main)> d = DateTime.new
=> #<DateTime: -4712-01-01T00:00:00+00:00 ((0j,0s,0n),+0s,2299161j)>
[8] pry(main)> d.to_time == d
=> false
UTC "should not" break anything since the time objects can be compared/transformed.
[1] pry(main)> t = Time.now
=> 2016-02-15 21:15:40 +0100
[2] pry(main)> t == t.utc
=> true
In #15 we ensured that we would get the same object out as we put into the start_time
/end_time
. That allowed users of the gem to easier compare the query dates with the result dates. Now they might be mutated if they aren't Time
objects.
Extra:
Interesting that we use Time
here but Post#indexed
and Post#published
return DateTime
objects
https://github.com/twingly/twingly-search-api-ruby/blob/750df991f0dc96405e0e96dcf6eb1805b82ccad2/lib/twingly/search/post.rb#L35-L36
Noticed that the documentation above
start_time=
does not show up in the yard documentation, but at least its documented in the code. Found an issue on yard for that: https://github.com/lsegal/yard/issues/516 but it doesn't look as it will be fixed :(close #43