Module: WurflStore
- Defined in:
- lib/wurfl_store.rb,
lib/wurfl_store/view.rb,
lib/wurfl_store/filter.rb,
lib/wurfl_store/cache_initializer.rb
Defined Under Namespace
Modules: CacheInitializer, Filter, View
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Attribute Details
#cache ⇒ Object
Returns the value of attribute cache.
9
10
11
|
# File 'lib/wurfl_store.rb', line 9
def cache
@cache
end
|
Class Method Details
.cache ⇒ Object
10
11
12
|
# File 'lib/wurfl_store.rb', line 10
def self.cache
@cache
end
|
.get_handset(user_agent) ⇒ Object
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/wurfl_store.rb', line 20
def self.get_handset(user_agent)
return nil if user_agent.nil?
CacheInitializer.cache_initialized?
user_agent.slice!(250..-1)
handset = @cache.read(user_agent.tr(' ', ''))
chopped_user_agent = user_agent.chop
return nil if chopped_user_agent.empty?
return self.get_handset(chopped_user_agent) if handset.nil?
return handset
end
|