Class: DoubleAgent::UserAgent

Inherits:
Object
  • Object
show all
Includes:
Resource
Defined in:
lib/double_agent/user_agent.rb

Overview

A class representing a browser’s user agent string. Various member methods parse and return browser and OS details.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Resource

#browser, #browser_family, #browser_family_sym, #browser_name, #browser_sym, #browser_version, #mobile?, #os, #os_family, #os_family_sym, #os_sym

Constructor Details

#initialize(user_agent_string) ⇒ UserAgent

Instantiate a new UserAgent object



10
11
12
# File 'lib/double_agent/user_agent.rb', line 10

def initialize(user_agent_string)
  @user_agent = user_agent_string
end

Instance Attribute Details

#user_agentObject (readonly)

The user agent string



7
8
9
# File 'lib/double_agent/user_agent.rb', line 7

def user_agent
  @user_agent
end