module Games
  class AddNonGiantbombGame < Games::Base

    attributes :name

    validates :name, presence: true

    def save
      return false unless valid?

      response = put "/games?name=#{name}"

      self.errors.add(:base, response.body["error"]) unless response.success?

      response.success?
    end
  end
end
