Class: DeviceAtlas::Device::DeviceApiWeb
- Defined in:
- lib/deviceatlas/device/device_api_web.rb
Overview
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.
Constant Summary
Constants inherited from DeviceApi
DeviceAtlas::Device::DeviceApi::API_VERSION
Instance Method Summary collapse
-
#get_properties(request) ⇒ Hash<Symbol, Object>
Get the Device properties for the given Net::HTTP request.
-
#initialize(config = nil) ⇒ Object
constructor
Creates a new DeviceAtlas::Device::DeviceApiWeb instance.
Methods inherited from DeviceApi
#data_creation_timestamp, #data_revision, #data_version, #load_data_from_file, #load_data_from_string, #property_names, #set_config
Constructor Details
#initialize(config = nil) ⇒ Object
Creates a new DeviceAtlas::Device::DeviceApiWeb instance.
Instance Method Details
#get_properties(request) ⇒ Hash<Symbol, Object>
Get the Device properties for the given Net::HTTP request. The most suitable headers are extracted and used for detection and property lookup.
If the client-side component has been used and the client-side properties exists in the client-side cookie, then the client-side properties will be included in the result and the device detection for certain devices such as iPhone models will be done more accurately.
Depending on the configuration, the final properties set may include User-Agent dynamic properties and language/locale properties.