Skip to content

Instantly share code, notes, and snippets.

@scharfie
Created April 9, 2014 17:37
Show Gist options
  • Save scharfie/10295505 to your computer and use it in GitHub Desktop.
Save scharfie/10295505 to your computer and use it in GitHub Desktop.
class Thing
def self.build(data)
thing = new(data)
thing.valid? ? thing : nil
end
def initialize(data)
@url = data[:url]
end
def valid?
return false if @url.nil?
return true
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment