Sha256: 9e45ce4429d0d9a41e824dd9ae7525025e1c25dcca0d6a2c326867e220c14772

Contents?: true

Size: 525 Bytes

Versions: 5

Compression:

Stored size: 525 Bytes

Contents

# frozen_string_literal: true

require_relative 'validation'

module Lino
  module Builders
    module Mixins
      module Appliables
        include Validation

        def with_appliable(appliable)
          return self if nil?(appliable)

          appliable.apply(self)
        end

        def with_appliables(appliables)
          return self if nil_or_empty?(appliables)

          appliables.inject(self) do |s, appliable|
            s.with_appliable(appliable)
          end
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
lino-3.2.0.pre.10 lib/lino/builders/mixins/appliables.rb
lino-3.2.0.pre.9 lib/lino/builders/mixins/appliables.rb
lino-3.2.0.pre.8 lib/lino/builders/mixins/appliables.rb
lino-3.2.0.pre.7 lib/lino/builders/mixins/appliables.rb
lino-3.2.0.pre.6 lib/lino/builders/mixins/appliables.rb