Skip to content

Instantly share code, notes, and snippets.

@jrabbit
Last active December 10, 2015 20:28
Show Gist options
  • Save jrabbit/4488673 to your computer and use it in GitHub Desktop.
Save jrabbit/4488673 to your computer and use it in GitHub Desktop.
class Resolution
attr_accessor :x, :y
def initialize(x, y)
@x = x
@y = y
end
def self.string(s)
if s.include?('x')
x, y = s.split('x')
else
x, y = s.split("\u{00D7}")
end
new(Integer(x),Integer(y))
end
def to_s
"#{@x} x #{@y}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment