Module: LightweightUserAgentParser::ContentAnalyzer
- Defined in:
- lib/lightweight_user_agent_parser/content_analyzer.rb
Instance Method Summary collapse
- #application ⇒ Object
- #browser_type ⇒ Object
- #compatible_mod ⇒ Object
- #operation_system ⇒ Object
- #to_hash ⇒ Object
Instance Method Details
#application ⇒ Object
4 5 6 |
# File 'lib/lightweight_user_agent_parser/content_analyzer.rb', line 4 def application chompify(user_agent_string.scan(/^(.*?) *\(/)[0][0]) rescue nil end |
#browser_type ⇒ Object
12 13 14 |
# File 'lib/lightweight_user_agent_parser/content_analyzer.rb', line 12 def browser_type inner_content_elements && inner_content_elements[1] end |
#compatible_mod ⇒ Object
8 9 10 |
# File 'lib/lightweight_user_agent_parser/content_analyzer.rb', line 8 def compatible_mod inner_content_elements && inner_content_elements[0] end |
#operation_system ⇒ Object
16 17 18 |
# File 'lib/lightweight_user_agent_parser/content_analyzer.rb', line 16 def operation_system inner_content_elements && inner_content_elements[2] end |
#to_hash ⇒ Object
20 21 22 23 24 |
# File 'lib/lightweight_user_agent_parser/content_analyzer.rb', line 20 def to_hash (ContentAnalyzer.public_instance_methods(false)-[:to_hash]).reduce({}) do |memory,method_name| memory.merge!(method_name => self.public_send(method_name));memory end end |