Module: UzuUzu::Helper::Controller
- Included in:
- Controller, Response
- Defined in:
- lib/uzuuzu-core/helper/controller.rb
Instance Method Summary collapse
- #action ⇒ Object
- #application ⇒ Object
- #controller ⇒ Object
- #h(s) ⇒ Object
- #helper ⇒ Object
- #instance_variable_map(instance) ⇒ Object
- #logger ⇒ Object
- #query ⇒ Object
- #query_string(query_options = {}) ⇒ Object
- #request ⇒ Object
- #response ⇒ Object
- #route ⇒ Object
- #service ⇒ Object
- #session ⇒ Object
- #u(s) ⇒ Object
Instance Method Details
#action ⇒ Object
57 58 59 |
# File 'lib/uzuuzu-core/helper/controller.rb', line 57 def action Thread.current[:action] end |
#application ⇒ Object
22 23 24 |
# File 'lib/uzuuzu-core/helper/controller.rb', line 22 def application ::UzuUzu.current end |
#controller ⇒ Object
29 30 31 |
# File 'lib/uzuuzu-core/helper/controller.rb', line 29 def controller ::UzuUzu.controller end |
#h(s) ⇒ Object
92 93 94 |
# File 'lib/uzuuzu-core/helper/controller.rb', line 92 def h(s) Rack::Utils.escape(s) end |
#helper ⇒ Object
50 51 52 |
# File 'lib/uzuuzu-core/helper/controller.rb', line 50 def helper ::UzuUzu.helper end |
#instance_variable_map(instance) ⇒ Object
119 120 121 122 123 124 125 |
# File 'lib/uzuuzu-core/helper/controller.rb', line 119 def instance_variable_map(instance) map = {} instance.instance_variables.each do |variable_name| map[variable_name] = instance.instance_variable_get(variable_name) end map end |
#logger ⇒ Object
15 16 17 |
# File 'lib/uzuuzu-core/helper/controller.rb', line 15 def logger ::UzuUzu.logger end |
#query ⇒ Object
64 65 66 |
# File 'lib/uzuuzu-core/helper/controller.rb', line 64 def query Thread.current[:query] end |
#query_string(query_options = {}) ⇒ Object
106 107 108 109 110 111 112 113 114 |
# File 'lib/uzuuzu-core/helper/controller.rb', line 106 def query_string(={}) return "" if .blank? query_string = [] do |key, value| query_string << "#{key}=#{value}" end return "" if query_string.blank? "?#{query_string.join('&')}" end |
#request ⇒ Object
36 37 38 |
# File 'lib/uzuuzu-core/helper/controller.rb', line 36 def request ::UzuUzu.request end |
#response ⇒ Object
43 44 45 |
# File 'lib/uzuuzu-core/helper/controller.rb', line 43 def response ::UzuUzu.response end |
#route ⇒ Object
71 72 73 |
# File 'lib/uzuuzu-core/helper/controller.rb', line 71 def route Thread.current[:route] end |
#service ⇒ Object
85 86 87 |
# File 'lib/uzuuzu-core/helper/controller.rb', line 85 def service ::UzuUzu.service end |
#session ⇒ Object
78 79 80 |
# File 'lib/uzuuzu-core/helper/controller.rb', line 78 def session request.session end |
#u(s) ⇒ Object
99 100 101 |
# File 'lib/uzuuzu-core/helper/controller.rb', line 99 def u(s) Rack::Utils.unescape(s) end |