Sha256: aef8ae3bc272d2057bcc1dbf2d3f1261c683a858c46482eb21b9206f8140c3e6

Contents?: true

Size: 1.77 KB

Versions: 12

Compression:

Stored size: 1.77 KB

Contents

=begin

Lesli

Copyright (c) 2023, Lesli Technologies, S. A.

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see http://www.gnu.org/licenses/.

Lesli · Ruby on Rails SaaS Development Framework.

Made with ♥ by https://www.lesli.tech
Building a better future, one line of code at a time.

@contact  hello@lesli.tech
@website  https://www.lesli.tech
@license  GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html

// · ~·~     ~·~     ~·~     ~·~     ~·~     ~·~     ~·~     ~·~     ~·~
// · 
=end

module Lesli
    class ApplicationLesliValidator

        # Set container attributes to manage the life-cycle of the service
        @resource;
        @failures;

        def initialize(resource)

            # stores the resources from the database as result of the active record queries
            @resource = resource

            # stores any error found during the life-cycle of the service object
            @failures = []

        end

        def valid?
            yield(failures.empty?, failures) if block_given?
            failures.empty?
        end

        private

        attr_reader :resource
        attr_writer :resource

        attr_reader :failures
        attr_writer :failures

        attr_reader :result
        attr_writer :result

    end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
lesli-5.0.13 app/validators/lesli/application_lesli_validator.rb
lesli-5.0.11 app/validators/lesli/application_lesli_validator.rb
lesli-5.0.10 app/validators/lesli/application_lesli_validator.rb
lesli-5.0.9 app/validators/lesli/application_lesli_validator.rb
lesli-5.0.7 app/validators/lesli/application_lesli_validator.rb
lesli-5.0.6 app/validators/lesli/application_lesli_validator.rb
lesli-5.0.5 app/validators/lesli/application_lesli_validator.rb
lesli-5.0.4 app/validators/lesli/application_lesli_validator.rb
lesli-5.0.3 app/validators/lesli/application_lesli_validator.rb
lesli-5.0.2 app/validators/lesli/application_lesli_validator.rb
lesli-5.0.1 app/validators/lesli/application_lesli_validator.rb
lesli-5.0.0 app/validators/lesli/application_lesli_validator.rb