Class: Mayu::Session::SerializedSession
- Inherits:
-
Object
- Object
- Mayu::Session::SerializedSession
- Extended by:
- T::Sig
- Defined in:
- lib/mayu/session.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(data) ⇒ SerializedSession
constructor
A new instance of SerializedSession.
- #marshal_dump ⇒ Object
- #marshal_load(a) ⇒ Object
- #to_session(environment) ⇒ Object
Constructor Details
#initialize(data) ⇒ SerializedSession
Returns a new instance of SerializedSession.
196 197 198 |
# File 'lib/mayu/session.rb', line 196 def initialize(data) @data = data end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
193 194 195 |
# File 'lib/mayu/session.rb', line 193 def data @data end |
Class Method Details
.dump_session(session) ⇒ Object
201 202 203 |
# File 'lib/mayu/session.rb', line 201 def self.dump_session(session) Marshal.dump(self.new(session.marshal_dump)) end |
Instance Method Details
#marshal_dump ⇒ Object
214 215 216 |
# File 'lib/mayu/session.rb', line 214 def marshal_dump @data end |
#marshal_load(a) ⇒ Object
219 220 221 |
# File 'lib/mayu/session.rb', line 219 def marshal_load(a) @data = a end |
#to_session(environment) ⇒ Object
206 207 208 209 210 211 |
# File 'lib/mayu/session.rb', line 206 def to_session(environment) session = Session.allocate session.instance_variable_set(:@environment, environment) session.marshal_load(@data) session end |