Sha256: 618922085819fb1a5af139f4566b9617e7b6bbac783754e754d663559ca332c6

Contents?: true

Size: 672 Bytes

Versions: 1

Compression:

Stored size: 672 Bytes

Contents

# frozen_string_literal: true

module Bemer
  module ContextExtentions
    module Structure
      def content(**options)
        old_params = Hash[node.params]

        node.params.merge!(options)

        output      = node.add_child_nodes
        node.params = old_params

        output
      end

      def ctx(**options)
        duplicate = node.dup

        duplicate.params.merge!(options)

        bem_cascade                          = node.tree.parent_node.bem_cascade
        duplicate.entity.bem_cascade         = bem_cascade
        duplicate.entity_builder.bem_cascade = bem_cascade

        node.tree.add(duplicate)

        nil
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bemer-0.1.0 lib/bemer/context_extentions/structure.rb