Skip to content
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 StateKey #28

Closed
ro31337 opened this issue May 11, 2016 · 0 comments
Closed

Add StateKey #28

ro31337 opened this issue May 11, 2016 · 0 comments

Comments

@ro31337
Copy link
Owner

ro31337 commented May 11, 2016

StateKey is object that represents the key for State object. There can be unlimited number of states (each state object is just a hash). Key is unique identifier used to to retrieve particular state (hash) from the storage.

It should have constructor that accepts parameters:

  • platformType - type of the platform
  • platformId - unique user identifier for this particular platform
  • guid - guid of the object that is using state

Idea is that state can be mixed into any object (as state property). And each menu action for particular user should have its own state. Menu actions can't have the same state for all users (that's why we can't have one guid parameter). State is not shared between users and between commands.

StateKey must have toString method that returns string representation of the key in the following format:

platform_userid_guid

Example:

telegram_31337_4566bd48-d369-4594-aa1e-fb5dae1acf43

Key should be lowercased.

ro31337 pushed a commit that referenced this issue May 11, 2016
ro31337 added a commit that referenced this issue May 11, 2016
@ro31337 ro31337 closed this as completed May 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant