Class: RWDSession

Inherits:
Hash show all
Defined in:
lib/rwd/rwd.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Hash

file, #ids, #rwd_table, #save, #subset, #to_i

Constructor Details

#initialize(sessionid = nil) ⇒ RWDSession

Returns a new instance of RWDSession.



1179
1180
1181
1182
1183
# File 'lib/rwd/rwd.rb', line 1179

def initialize(sessionid=nil)
  @sessionid    = sessionid
  @lastaccess   = Time.now
  @authenticated  = false
end

Instance Attribute Details

#authenticatedObject

Returns the value of attribute authenticated.



1176
1177
1178
# File 'lib/rwd/rwd.rb', line 1176

def authenticated
  @authenticated
end

#lastaccessObject (readonly)

Returns the value of attribute lastaccess.



1175
1176
1177
# File 'lib/rwd/rwd.rb', line 1175

def lastaccess
  @lastaccess
end

#sessionidObject (readonly)

Returns the value of attribute sessionid.



1174
1175
1176
# File 'lib/rwd/rwd.rb', line 1174

def sessionid
  @sessionid
end

Instance Method Details

#render(res, path, post, download, downloadfile, pda = false) ⇒ Object



1189
1190
1191
1192
1193
1194
1195
# File 'lib/rwd/rwd.rb', line 1189

def render(res, path, post, download, downloadfile, pda=false)
  done  = self["object"].render(res, path, post, download, downloadfile, pda, @sessionid)

  res.gsub!(/\$RWD_SESSION\$/, done ? "" : "#{@sessionid}")

  return done
end

#touchObject



1185
1186
1187
# File 'lib/rwd/rwd.rb', line 1185

def touch
  @lastaccess = Time.now
end