Created
February 25, 2014 20:53
-
-
Save apeiros/9217497 to your computer and use it in GitHub Desktop.
This file contains 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
module MyApp | |
class Link | |
def self.json(json_string) | |
new(JSON.parse(json_string)) # could add a json-schema validation here, fitting Link | |
end | |
attr_accessor :rel, :href | |
def initialize(rel: nil, href: nil) | |
@rel = rel | |
@href = href | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment