Class: CGI::Session::DRbSession
- Inherits:
-
Object
- Object
- CGI::Session::DRbSession
- Defined in:
- lib/cgi/drbsession.rb
Instance Attribute Summary collapse
-
#obj ⇒ Object
readonly
Returns the value of attribute obj.
Instance Method Summary collapse
- #close ⇒ Object
- #delete ⇒ Object
-
#initialize(session, option = {}) ⇒ DRbSession
constructor
A new instance of DRbSession.
- #restore ⇒ Object
- #update ⇒ Object
Constructor Details
#initialize(session, option = {}) ⇒ DRbSession
Returns a new instance of DRbSession.
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/cgi/drbsession.rb', line 12 def initialize(session, option={}) unless uri = option['drbsession_uri'] raise ArgumentError, "drbsession_uri not specified" end unless DRb.thread DRb.start_service end holder = DRbObject.new(nil, uri) @obj = holder[session.session_id] end |
Instance Attribute Details
#obj ⇒ Object (readonly)
Returns the value of attribute obj.
11 12 13 |
# File 'lib/cgi/drbsession.rb', line 11 def obj @obj end |
Instance Method Details
#close ⇒ Object
31 32 33 |
# File 'lib/cgi/drbsession.rb', line 31 def close @obj.close end |
#delete ⇒ Object
34 35 36 |
# File 'lib/cgi/drbsession.rb', line 34 def delete @obj.delete end |
#restore ⇒ Object
25 26 27 |
# File 'lib/cgi/drbsession.rb', line 25 def restore @obj.restore end |
#update ⇒ Object
28 29 30 |
# File 'lib/cgi/drbsession.rb', line 28 def update @obj.update end |