module Em::Sessions

Constants

VERSION

Attributes

app[RW]
last_client[RW]
url[RW]

Public Class Methods

client(url = nil, app = nil) click to toggle source
# 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') click to toggle source

if use init, every each call client, this client are same

# File lib/em-sessions.rb, line 11
def init(url = 'localhost:3000', app = 'weapp')
  @url = url
  @app = app
end