Skip to content

Commit

Permalink
Fixed AgentOrange::UserAgent.new syntax to match the README.
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinelliott committed Sep 12, 2011
1 parent eb9c894 commit f203ad8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion bin/agent_orange_example
Expand Up @@ -23,7 +23,7 @@ def process_user_agent(ua_str)
puts "Original User Agent:"
puts " #{ua_str}"
puts
ua = AgentOrange::UserAgent.new(:user_agent => ua_str)
ua = AgentOrange::UserAgent.new(ua_str)
puts "Parsed Object String:"
puts " #{ua}"
puts '='*120
Expand Down
6 changes: 2 additions & 4 deletions lib/agent_orange/user_agent.rb
Expand Up @@ -9,10 +9,8 @@ class UserAgent
attr_accessor :user_language
attr_accessor :device

def initialize(options = {}, &block)
self.parse(options[:user_agent].to_s)

yield self if block_given?
def initialize(user_agent_string)
self.parse(user_agent_string)
end

def parse(user_agent)
Expand Down

0 comments on commit f203ad8

Please sign in to comment.