Sha256: 87d16525485f409785ac8f687f54891d9681f66060ec26733e697c59ffeedfd4

Contents?: true

Size: 367 Bytes

Versions: 3

Compression:

Stored size: 367 Bytes

Contents

require 'supa/command'

module Supa
  module Commands
    class Collection < Supa::Command
      def represent
        tree[name] = []

        Array(dynamic_value).each do |element|
          tree[name] << {}

          Supa::Builder.new(representer: representer, context: element, tree: tree[name][-1]).instance_exec(&block)
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
supa-0.2.3 lib/supa/commands/collection.rb
supa-0.2.2 lib/supa/commands/collection.rb
supa-0.2.1 lib/supa/commands/collection.rb