-
Notifications
You must be signed in to change notification settings - Fork 55
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
API/naming discussion #15
Comments
Thanks for typing this up! It's great. Concepts
Current public API methods
To-do
|
Proposed API MethodsHere's what I'd like to see included in the API. Let me know what you think!
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Concepts
$hours
combined with$exceptions
(if applicable).Current public API methods
is_open
returnstrue
when the shop is OPEN.render
returns a string whose actual content is rather hard to describe. I skip that for now. The method works okay-ish, I guess.Return value is based on: current server day, REAL HOURS
hours_today
returns the REAL HOURS for the current day. If the shop is OPEN LATE at the time of the method call, this method still returns the current day’s hours and not yesterday’s.If current day’s hours have an OPEN LATE part (e. g.
19:00-03:00
), it will be included in the return value (it won’t be cut at midnight). OPEN LATE hours from yesterday will never be included in the return value.This method’s focus is “informational.” If you have hours for a club, sat: 21:00-05:00, sun: closed, and you call this method at Sun, 1am, it will tell you that the club is closed on Sundays. It won’t tell you that you have got 4 hours left for a visit during the OPEN LATE time from Saturday.
Return value should be based on: current server week, REAL HOURS
I quote parts of my comment to f63b117:
My initial intention for
hours_overview
(the predecessor of this method) was to allow the user to create a table of default$hours
without regards to$exceptions
. I think that we need a method to do this and that we need a more generic name for it.The text was updated successfully, but these errors were encountered: