Class: UserAgentSanitizer::UserAgent

Inherits:
Object
  • Object
show all
Defined in:
lib/user_agent_sanitizer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(user_agent) ⇒ UserAgent

Returns a new instance of UserAgent.



24
25
26
# File 'lib/user_agent_sanitizer.rb', line 24

def initialize(user_agent)
  @user_agent = user_agent.dup
end

Instance Attribute Details

#brandObject

Returns the value of attribute brand.



22
23
24
# File 'lib/user_agent_sanitizer.rb', line 22

def brand
  @brand
end

#modelObject

Returns the value of attribute model.



22
23
24
# File 'lib/user_agent_sanitizer.rb', line 22

def model
  @model
end

#user_agentObject

Returns the value of attribute user_agent.



22
23
24
# File 'lib/user_agent_sanitizer.rb', line 22

def user_agent
  @user_agent
end

Instance Method Details

#to_sObject



38
39
40
# File 'lib/user_agent_sanitizer.rb', line 38

def to_s
  "#{brand} #{model}".strip
end