Sha256: 458d13ec62193c03284f4ccee16d95e628b669f994f72c0eea19e44982c7b33f

Contents?: true

Size: 798 Bytes

Versions: 2

Compression:

Stored size: 798 Bytes

Contents

require 'contents_core/blocks'
require 'contents_core/engine'

module ContentsCore
  def self.config( options = {} )
    @@config.merge! options
    @@config
  end

  def self.create_block_in_parent( parent, type = :text, params = {} )
    block = Block.new( block_type: type )
    block.name = params[:name] if params[:name]
    block.options = params[:options] if params[:options]
    block.validations = params[:validations] if params[:validations]
    block.create_children = params[:create_children].to_i if params[:create_children]
    parent.cc_blocks << block
    Block::init_items block, params[:schema], {create_children: params[:create_children]} if params[:schema]
    block
  end

  def self.editing( editing = nil )
    @@editing = editing unless editing.nil?
    @@editing
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
contents_core-0.2.5 lib/contents_core.rb
contents_core-0.2.4 lib/contents_core.rb