Module: UzuUzu::Helper::Controller

Included in:
Controller, Response
Defined in:
lib/uzuuzu-core/helper/controller.rb

Instance Method Summary collapse

Instance Method Details

#actionObject



57
58
59
# File 'lib/uzuuzu-core/helper/controller.rb', line 57

def action
  Thread.current[:action]
end

#applicationObject



22
23
24
# File 'lib/uzuuzu-core/helper/controller.rb', line 22

def application
  ::UzuUzu.current
end

#controllerObject



29
30
31
# File 'lib/uzuuzu-core/helper/controller.rb', line 29

def controller
  ::UzuUzu.controller
end

#dmObject



85
86
87
# File 'lib/uzuuzu-core/helper/controller.rb', line 85

def dm
  ::UzuUzu.dm
end

#h(s) ⇒ Object



99
100
101
# File 'lib/uzuuzu-core/helper/controller.rb', line 99

def h(s)
  Rack::Utils.escape(s)
end

#helperObject



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

#loggerObject



15
16
17
# File 'lib/uzuuzu-core/helper/controller.rb', line 15

def logger
  ::UzuUzu.logger
end

#queryObject



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(query_options={})
  return "" if query_options.blank?
  query_string = []
  query_options do |key, value|
    query_string << "#{key}=#{value}"
  end
  return "" if query_string.blank?
  "?#{query_string.join('&')}"
end

#requestObject



36
37
38
# File 'lib/uzuuzu-core/helper/controller.rb', line 36

def request
  ::UzuUzu.request
end

#responseObject



43
44
45
# File 'lib/uzuuzu-core/helper/controller.rb', line 43

def response
  ::UzuUzu.response
end

#routeObject



71
72
73
# File 'lib/uzuuzu-core/helper/controller.rb', line 71

def route
  Thread.current[:route]
end

#s3Object



92
93
94
# File 'lib/uzuuzu-core/helper/controller.rb', line 92

def s3
  ::UzuUzu.s3
end

#sessionObject



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