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.



1144
1145
1146
1147
1148
# File 'lib/rwd/rwd.rb', line 1144

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

Instance Attribute Details

#authenticatedObject

Returns the value of attribute authenticated.



1141
1142
1143
# File 'lib/rwd/rwd.rb', line 1141

def authenticated
  @authenticated
end

#lastaccessObject (readonly)

Returns the value of attribute lastaccess.



1140
1141
1142
# File 'lib/rwd/rwd.rb', line 1140

def lastaccess
  @lastaccess
end

#sessionidObject (readonly)

Returns the value of attribute sessionid.



1139
1140
1141
# File 'lib/rwd/rwd.rb', line 1139

def sessionid
  @sessionid
end

Instance Method Details

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



1154
1155
1156
1157
1158
1159
1160
# File 'lib/rwd/rwd.rb', line 1154

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

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

  return done
end

#touchObject



1150
1151
1152
# File 'lib/rwd/rwd.rb', line 1150

def touch
  @lastaccess	= Time.now
end