Copyright © 2014 by mTLD Top Level Domain Limited. All rights reserved.
Portions copyright © 2008 by Argo Interactive Limited.
Portions copyright © 2008 by Nokia Inc.
Portions copyright © 2008 by Telecom Italia Mobile S.p.A.
Portions copyright © 2008 by Volantis Systems Limited.
Portions copyright © 2002-2008 by Andreas Staeding.
Portions copyright © 2008 by Zandan.
dotMobi
DeviceApiWeb is the class that lets us use user's headers transparently. We do not need to explicitly pass them as parameter to the properties() method.
# File ../../device_api/trunk/ruby/src/lib/device_api_web.rb, line 24 def initialize headers, cookies, settings = nil @headers = headers @cookies = cookies super(settings) end
Get known properties either transparently from the request or from the given User-Agent, headers or Client side properties.
user_agent_or_headers
User-Agent string or array of HTTP headers.
client_side_properties
String of client side properties with the
format the client side component provides.
return
Array of Property objects.
# File ../../device_api/trunk/ruby/src/lib/device_api_web.rb, line 37 def properties user_agent_or_headers = nil, client_side_properties = nil # If no UA or headers are specified, get it from the request. if user_agent_or_headers.nil? user_agent_or_headers = @headers end # If no Client side properties are specified, get it from the cookie. if client_side_properties.nil? if !@cookies.nil? && @cookies.has_key?(@settings.cookie_name) client_side_properties = @cookies[@settings.cookie_name] end end return super(user_agent_or_headers, client_side_properties) end