Sha256: cf213e9180c19d58ffc269304ab8e5e9d78fb3dc23c8abd00502fcf891b29774

Contents?: true

Size: 1.07 KB

Versions: 9

Compression:

Stored size: 1.07 KB

Contents

require_relative '../../models/student/student.rb'
require_relative './edit_student_presenter'

# == Edit_git_presenter
# Презентер для редактирования информации о GitHub аккаунте студента.
class Edit_git_presenter < Edit_student_presenter

  # Заполнение полей интерфейса текущими данными о Git студента.
  def populate_fields
    self.get_student
    data = {
      "git" => self.student.git,
    }
    self.view.update_view data
  end

  # Проверка валидности данных о Git.
  #
  # @param student_data [Hash] Данные о Git.
  # @return [Boolean] Возвращает true, если данные валидны.
  def valid_data?(student_data)
    data = student_data.transform_values { |value| value.strip }
    self.logger.debug "Проверка валидности данных: #{data.to_s}"
    res = Student.valid_git?(data["git"]) && self.student.git != data["git"]
    self.logger.info "Валидность данных: #{res}"
    res
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
student_mvp-0.1.10 lib/presenters/edit_student/edit_git_presenter.rb
student_mvp-0.1.9 lib/presenters/edit_student/edit_git_presenter.rb
student_mvp-0.1.8 lib/presenters/edit_student/edit_git_presenter.rb
student_mvp-0.1.7 lib/presenters/edit_student/edit_git_presenter.rb
student_mvp-0.1.6 lib/presenters/edit_student/edit_git_presenter.rb
student_mvp-0.1.5 lib/presenters/edit_student/edit_git_presenter.rb
student_mvp-0.1.4 lib/presenters/edit_student/edit_git_presenter.rb
student_mvp-0.1.3 lib/presenters/edit_student/edit_git_presenter.rb
student_mvp-0.1.2 lib/presenters/edit_student/edit_git_presenter.rb