Sha256: 6d68f8c46d164bfa47591e048458048be26757384a76a332871c7a8165c6ea49

Contents?: true

Size: 337 Bytes

Versions: 3

Compression:

Stored size: 337 Bytes

Contents

require 'supa/command'

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

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

          Supa::Builder.new(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.1.4 lib/supa/commands/collection.rb
supa-0.1.3 lib/supa/commands/collection.rb
supa-0.1.2 lib/supa/commands/collection.rb