Last active
December 10, 2015 20:28
-
-
Save jrabbit/4488673 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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