lib/rack/schmobile/request_extension.rb in schmobile-0.1.3 vs lib/rack/schmobile/request_extension.rb in schmobile-0.2.0

- old
+ new

@@ -1,14 +1,13 @@ module Rack module Schmobile module Request def is_mobile? - Rack::Schmobile::Filters::CHAIN.each do |filter| - result = filter.call(self) - return result unless result.nil? + unless defined?(@is_mobile) + @is_mobile = Rack::Schmobile::Filters.apply(self) end - false + @is_mobile end def is_device?(identifier) user_agent =~ /#{identifier}/i end