Sha256: a59321a954b68f92d7e24e72d962aafe67cfb09496bf365331a693c64f81209f
Contents?: true
Size: 939 Bytes
Versions: 22
Compression:
Stored size: 939 Bytes
Contents
# frozen_string_literal: true require_relative '../../models/project' require_relative '../base_presenter_ex' module Dsu module Presenters module Project class CreatePresenter < BasePresenterEx delegate :project_name, to: :project def initialize(project_name:, description:, options: {}) super(options: options) @project = Models::Project.new(project_name: project_name, description: description, options: options) end def respond(response:) return false unless response project.create! end def project_already_exists? project.exist? end def project_errors? project.invalid? end def project_errors return [] unless project_errors? project.errors.full_messages end private attr_reader :project, :options end end end end
Version data entries
22 entries across 22 versions & 1 rubygems