Sha256: 7ba63542e167085a9c6d4695db0795069af1e6f59db76d69926904adb7774519

Contents?: true

Size: 364 Bytes

Versions: 14

Compression:

Stored size: 364 Bytes

Contents

# frozen_string_literal: true

require "core"

module Tana
  module Models
    # A root node.
    Root = Data.define :children do
      def self.for(node: Node, **attributes)
        attributes.fetch(:children, Core::EMPTY_ARRAY)
                  .map { |child| node.for(**child) }
                  .then { |children| new children: }
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
tana-0.14.0 lib/tana/models/root.rb
tana-0.13.0 lib/tana/models/root.rb
tana-0.12.0 lib/tana/models/root.rb
tana-0.11.0 lib/tana/models/root.rb
tana-0.10.0 lib/tana/models/root.rb
tana-0.9.0 lib/tana/models/root.rb
tana-0.8.0 lib/tana/models/root.rb
tana-0.7.0 lib/tana/models/root.rb
tana-0.6.0 lib/tana/models/root.rb
tana-0.4.0 lib/tana/models/root.rb
tana-0.3.0 lib/tana/models/root.rb
tana-0.2.0 lib/tana/models/root.rb
tana-0.1.0 lib/tana/models/root.rb
tana-0.0.0 lib/tana/models/root.rb