Module: Em::Sessions
- Defined in:
- lib/em-sessions.rb,
lib/em/sessions/client.rb,
lib/em/sessions/version.rb
Defined Under Namespace
Classes: Client
Constant Summary collapse
- VERSION =
"0.3.0"
Class Attribute Summary collapse
-
.app ⇒ Object
Returns the value of attribute app.
-
.last_client ⇒ Object
Returns the value of attribute last_client.
-
.url ⇒ Object
Returns the value of attribute url.
Class Method Summary collapse
- .client(url = nil, app = nil) ⇒ Object
-
.init(url = 'localhost:3000', app = 'weapp') ⇒ Object
if use init, every each call client, this client are same.
Class Attribute Details
.app ⇒ Object
Returns the value of attribute app.
7 8 9 |
# File 'lib/em-sessions.rb', line 7 def app @app end |
.last_client ⇒ Object
Returns the value of attribute last_client.
7 8 9 |
# File 'lib/em-sessions.rb', line 7 def last_client @last_client end |
.url ⇒ Object
Returns the value of attribute url.
7 8 9 |
# File 'lib/em-sessions.rb', line 7 def url @url end |
Class Method Details
.client(url = nil, app = nil) ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/em-sessions.rb', line 16 def client(url = nil, app = nil) set_url = url.nil? ? @url : url set_app = app.nil? ? @app : app raise 'Please input url or app_name,such as: client("localhost:3000", "weapp")' if set_url.nil? || set_app.nil? @last_client = Client.new set_url, set_app @last_client end |
.init(url = 'localhost:3000', app = 'weapp') ⇒ Object
if use init, every each call client, this client are same
11 12 13 14 |
# File 'lib/em-sessions.rb', line 11 def init(url = 'localhost:3000', app = 'weapp') @url = url @app = app end |