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
- #dm ⇒ 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
- #s3 ⇒ 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
99 100 101 |
# File 'lib/uzuuzu-core/helper/controller.rb', line 99 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
126 127 128 129 130 131 132 |
# File 'lib/uzuuzu-core/helper/controller.rb', line 126 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
113 114 115 116 117 118 119 120 121 |
# File 'lib/uzuuzu-core/helper/controller.rb', line 113 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 |
#session ⇒ Object
78 79 80 |
# File 'lib/uzuuzu-core/helper/controller.rb', line 78 def session request.session end |
#u(s) ⇒ Object
106 107 108 |
# File 'lib/uzuuzu-core/helper/controller.rb', line 106 def u(s) Rack::Utils.unescape(s) end |