Parent

Class Index [+]

Quicksearch

Ramaze::Helper::Localize::Parser

Attributes

request[RW]

Public Class Methods

new(request) click to toggle source
     # File lib/ramaze/helper/localize.rb, line 108
108:         def initialize(request)
109:           @request = request
110:         end

Public Instance Methods

locales(fallback = nil) click to toggle source
     # File lib/ramaze/helper/localize.rb, line 112
112:         def locales(fallback = nil)
113:           locales = [parse, fallback].flatten.uniq
114:           ::Locale::TagList.new(locales)
115:         end
parse() click to toggle source
     # File lib/ramaze/helper/localize.rb, line 117
117:         def parse
118:           parse_params || parse_session || parse_cookie || parse_header
119:         end
parse_header() click to toggle source
     # File lib/ramaze/helper/localize.rb, line 136
136:         def parse_header
137:           request.accept_language.map{|lang|
138:             ::Locale::Tag.parse(lang) }
139:         end
parse_params(key = 'lang') click to toggle source
     # File lib/ramaze/helper/localize.rb, line 121
121:         def parse_params(key = 'lang')
122:           return unless lang = request.params[key]
123:           ::Locale::Tag.parse(lang)
124:         end
parse_session(key = :lang) click to toggle source
     # File lib/ramaze/helper/localize.rb, line 126
126:         def parse_session(key = :lang)
127:           return unless lang = Current.session[key]
128:           ::Locale::Tag.parse(lang)
129:         end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.