def save
      raise Error::InvalidBuildType.new(type) unless BUILD_TYPES.include?(type)

      file = Tempfile.new("build.json")
      file.write(to_json)
      file.rewind

      client.put("/api/build", file,
        "Content-Type" => "application/json"
      )
      true
    ensure
      if file
        file.close
        file.unlink
      end
    end
def save
      raise Error::InvalidBuildType.new(type) unless BUILD_TYPES.include?(type)

      file = Tempfile.new("build.json")
      file.write(to_json)
      file.rewind

      client.put("/api/build", file,
        "Content-Type" => "application/json"
      )
      true
    ensure
      if file
        file.close
        file.unlink
      end
    end
Creates data about a build.

 @return [Boolean]