Sha256: 80385d6d96ea49d2d56a816a1c47e82ff6476c447e194ddec6b07aaf777422bd

Contents?: true

Size: 340 Bytes

Versions: 3

Compression:

Stored size: 340 Bytes

Contents

require 'supa/command'

module Supa
  module Commands
    class Polymorphic < 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/polymorphic.rb
supa-0.1.3 lib/supa/commands/polymorphic.rb
supa-0.1.2 lib/supa/commands/polymorphic.rb