Skip to content

Commit

Permalink
Prettier inspect.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnunemaker committed Jun 22, 2011
1 parent 343f524 commit 06ae432
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/user_agent.rb
Expand Up @@ -173,7 +173,11 @@ def to_s
end

def inspect
"#<UserAgent:#{name} version:#{version.inspect} engine:\"#{engine.to_s}:#{engine_version}\" os:#{os.to_s.inspect}>"
attributes_as_nice_string = AttributesForInspect.map do |name|
"#{name}: #{send(name).inspect}"
end.join(', ')

"#<#{self.class}: #{attributes_as_nice_string}>"
end

def eql?(other)
Expand Down

0 comments on commit 06ae432

Please sign in to comment.