class UserAgent
def initialize(product, version = nil, comment = nil)
def initialize(product, version = nil, comment = nil) if product @product = product else raise ArgumentError, "expected a value for product" end if version && !version.empty? @version = version else @version = nil end if comment.respond_to?(:split) @comment = comment.split("; ") else @comment = comment end end