Sha256: 34a7398cb77a2127bf551481e166db375ce36c3513fc7a98c1f1ad07b6a82d0d

Contents?: true

Size: 384 Bytes

Versions: 12

Compression:

Stored size: 384 Bytes

Contents

# frozen_string_literal: true

module Lino
  module Builders
    module Mixins
      module Defaulting
        private

        def or_nil(enumerable, key)
          enumerable.include?(key) ? enumerable[key] : nil
        end

        def or_nth(enumerable, key, index)
          enumerable.include?(key) ? enumerable[key] : enumerable[index]
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
lino-4.2.0.pre.2 lib/lino/builders/mixins/defaulting.rb
lino-4.2.0.pre.1 lib/lino/builders/mixins/defaulting.rb
lino-4.1.0 lib/lino/builders/mixins/defaulting.rb
lino-4.1.0.pre.2 lib/lino/builders/mixins/defaulting.rb
lino-4.1.0.pre.1 lib/lino/builders/mixins/defaulting.rb
lino-4.0.0 lib/lino/builders/mixins/defaulting.rb
lino-4.0.0.pre.2 lib/lino/builders/mixins/defaulting.rb
lino-3.2.0.pre.10 lib/lino/builders/mixins/defaulting.rb
lino-3.2.0.pre.9 lib/lino/builders/mixins/defaulting.rb
lino-3.2.0.pre.8 lib/lino/builders/mixins/defaulting.rb
lino-3.2.0.pre.7 lib/lino/builders/mixins/defaulting.rb
lino-3.2.0.pre.6 lib/lino/builders/mixins/defaulting.rb