Class: IRuby::SessionAdapter::BaseAdapter

Inherits:
Object
  • Object
show all
Defined in:
lib/iruby/session_adapter.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ BaseAdapter

Returns a new instance of BaseAdapter.



13
14
15
# File 'lib/iruby/session_adapter.rb', line 13

def initialize(config)
  @config = config
end

Class Method Details

.available?Boolean

Returns:

  • (Boolean)


6
7
8
9
10
11
# File 'lib/iruby/session_adapter.rb', line 6

def self.available?
  load_requirements
  true
rescue LoadError
  false
end

Instance Method Details

#make_pub_socket(protocol, host, port) ⇒ Object



26
27
28
29
# File 'lib/iruby/session_adapter.rb', line 26

def make_pub_socket(protocol, host, port)
  socket, port = make_socket(:PUB, protocol, host, port)
  [socket, port]
end

#make_rep_socket(protocol, host, port) ⇒ Object



31
32
33
34
# File 'lib/iruby/session_adapter.rb', line 31

def make_rep_socket(protocol, host, port)
  socket, port = make_socket(:REP, protocol, host, port)
  [socket, port]
end

#make_router_socket(protocol, host, port) ⇒ Object



21
22
23
24
# File 'lib/iruby/session_adapter.rb', line 21

def make_router_socket(protocol, host, port)
  socket, port = make_socket(:ROUTER, protocol, host, port)
  [socket, port]
end

#nameObject



17
18
19
# File 'lib/iruby/session_adapter.rb', line 17

def name
  self.class.name[/::(\w+)Adapter\Z/, 1].downcase
end