Class: Rack::Request
- Defined in:
- lib/utopia/middleware/localization.rb,
lib/utopia/middleware/controller.rb,
lib/utopia/extensions/rack.rb
Instance Method Summary collapse
- #all_locales ⇒ Object
- #controller(&block) ⇒ Object
- #current_locale ⇒ Object
- #localization ⇒ Object
- #url_with_path(path = "") ⇒ Object
Instance Method Details
#all_locales ⇒ Object
30 31 32 |
# File 'lib/utopia/middleware/localization.rb', line 30 def all_locales localization.all_locales end |
#controller(&block) ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/utopia/middleware/controller.rb', line 26 def controller(&block) if block_given? env["utopia.controller"].instance_eval(&block) else env["utopia.controller"] end end |
#current_locale ⇒ Object
26 27 28 |
# File 'lib/utopia/middleware/localization.rb', line 26 def current_locale env["utopia.current_locale"] end |
#localization ⇒ Object
34 35 36 |
# File 'lib/utopia/middleware/localization.rb', line 34 def localization env["utopia.localization"] end |
#url_with_path(path = "") ⇒ Object
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/utopia/extensions/rack.rb', line 24 def url_with_path(path = "") url = scheme + "://" url << host if scheme == "https" && port != 443 || scheme == "http" && port != 80 url << ":#{port}" end url << path end |