Top Level Namespace
Defined Under Namespace
Classes: Knjappserver
Instance Method Summary collapse
- #_(str) ⇒ Object
-
#_buf ⇒ Object
This function makes it possible to define methods in ERubis-parsed files (else _buf-variable wouldnt be globally available).
- #_cookie ⇒ Object
- #_db ⇒ Object
- #_get ⇒ Object
- #_httpsession ⇒ Object
- #_httpsession_var ⇒ Object
- #_kas ⇒ Object
- #_meta ⇒ Object
- #_post ⇒ Object
- #_requestdata ⇒ Object
- #_server ⇒ Object
- #_session ⇒ Object
- #_session_hash ⇒ Object
- #_session_obj ⇒ Object
- #_vars ⇒ Object
Instance Method Details
#_(str) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/include/gettext_funcs.rb', line 3 def _(str) kas = _kas session = _session locale = nil if Thread.current[:locale].to_s.length > 0 locale = Thread.current[:locale] elsif session and session[:locale].to_s.strip.length > 0 locale = session[:locale] elsif kas and kas.config[:locale_default].to_s.strip.length > 0 session[:locale] = kas.config[:locale_default] if session locale = kas.config[:locale_default] elsif !session and !kas return str else raise "No locale set for session and ':locale_default' not set in config." end return kas.gettext.trans(locale, str) end |
#_buf ⇒ Object
This function makes it possible to define methods in ERubis-parsed files (else _buf-variable wouldnt be globally available).
59 60 61 |
# File 'lib/include/magic_methods.rb', line 59 def _buf return $stdout end |
#_cookie ⇒ Object
1 2 3 |
# File 'lib/include/magic_methods.rb', line 1 def return Thread.current[:knjappserver][:cookie] if Thread.current[:knjappserver] end |
#_db ⇒ Object
53 54 55 56 |
# File 'lib/include/magic_methods.rb', line 53 def _db return Thread.current[:knjappserver][:db] if Thread.current[:knjappserver] and Thread.current[:knjappserver][:db] #This is the default use from a .rhtml-file. return Thread.current[:knjappserver][:kas].db_handler if Thread.current[:knjappserver] and Thread.current[:knjappserver][:kas] #This is useually used when using autoload-argument for the appserver. end |
#_get ⇒ Object
5 6 7 |
# File 'lib/include/magic_methods.rb', line 5 def _get return Thread.current[:knjappserver][:get] if Thread.current[:knjappserver] end |
#_httpsession ⇒ Object
33 34 35 |
# File 'lib/include/magic_methods.rb', line 33 def _httpsession return Thread.current[:knjappserver][:httpsession] if Thread.current[:knjappserver] end |
#_httpsession_var ⇒ Object
37 38 39 |
# File 'lib/include/magic_methods.rb', line 37 def _httpsession_var return Thread.current[:knjappserver][:httpsession].httpsession_var if Thread.current[:knjappserver] end |
#_kas ⇒ Object
45 46 47 |
# File 'lib/include/magic_methods.rb', line 45 def _kas return Thread.current[:knjappserver][:kas] if Thread.current[:knjappserver] end |
#_meta ⇒ Object
13 14 15 |
# File 'lib/include/magic_methods.rb', line 13 def return Thread.current[:knjappserver][:meta] if Thread.current[:knjappserver] end |
#_post ⇒ Object
9 10 11 |
# File 'lib/include/magic_methods.rb', line 9 def _post return Thread.current[:knjappserver][:post] if Thread.current[:knjappserver] end |
#_requestdata ⇒ Object
41 42 43 |
# File 'lib/include/magic_methods.rb', line 41 def _requestdata return Thread.current[:knjappserver] if Thread.current[:knjappserver] end |
#_server ⇒ Object
17 18 19 |
# File 'lib/include/magic_methods.rb', line 17 def _server return Thread.current[:knjappserver][:meta] if Thread.current[:knjappserver] end |
#_session ⇒ Object
21 22 23 |
# File 'lib/include/magic_methods.rb', line 21 def _session return Thread.current[:knjappserver][:session].sess_data if Thread.current[:knjappserver] and Thread.current[:knjappserver][:session] end |
#_session_hash ⇒ Object
25 26 27 |
# File 'lib/include/magic_methods.rb', line 25 def _session_hash return Thread.current[:knjappserver][:session].edata if Thread.current[:knjappserver] and Thread.current[:knjappserver][:session] end |
#_session_obj ⇒ Object
29 30 31 |
# File 'lib/include/magic_methods.rb', line 29 def _session_obj return Thread.current[:knjappserver][:session] if Thread.current[:knjappserver] and Thread.current[:knjappserver][:session] end |
#_vars ⇒ Object
49 50 51 |
# File 'lib/include/magic_methods.rb', line 49 def _vars return Thread.current[:knjappserver][:kas].vars if Thread.current[:knjappserver] end |