Class: ItunesController::ServerState
- Inherits:
-
Object
- Object
- ItunesController::ServerState
- Defined in:
- lib/itunesController/controllserver.rb
Overview
Used to store the state within the server of each connected client
Constant Summary collapse
- NOT_AUTHED =
1
- DOING_AUTH =
2
- AUTHED =
3
Instance Attribute Summary collapse
-
#config ⇒ ItunesController::ServerConfig
The server configuration.
-
#files ⇒ Array[String]
An array that contains the list of registered files the client is working on.
-
#state ⇒ Number
The server state.
-
#user ⇒ String
The logged in user.
Instance Method Summary collapse
- #clean ⇒ Object
-
#initialize(config) ⇒ ServerState
constructor
A new instance of ServerState.
Constructor Details
#initialize(config) ⇒ ServerState
Returns a new instance of ServerState.
78 79 80 81 82 |
# File 'lib/itunesController/controllserver.rb', line 78 def initialize(config) @state=ServerState::NOT_AUTHED @files=[] @config=config end |
Instance Attribute Details
#config ⇒ ItunesController::ServerConfig
The server configuration
70 71 72 |
# File 'lib/itunesController/controllserver.rb', line 70 def config @config end |
#files ⇒ Array[String]
An array that contains the list of registered files the client is working on
70 71 72 |
# File 'lib/itunesController/controllserver.rb', line 70 def files @files end |
#state ⇒ Number
The server state. Either ServerState::NOT_AUTHED, ServerState::DOING_AUTHED or ServerState::AUTHED
70 71 72 |
# File 'lib/itunesController/controllserver.rb', line 70 def state @state end |
#user ⇒ String
The logged in user
70 71 72 |
# File 'lib/itunesController/controllserver.rb', line 70 def user @user end |
Instance Method Details
#clean ⇒ Object
84 85 86 87 |
# File 'lib/itunesController/controllserver.rb', line 84 def clean @state=ServerState::NOT_AUTHED @files=[] end |