Module: ContentsCore

Defined in:
app/models/contents_core/item_object.rb,
lib/contents_core.rb,
lib/contents_core/blocks.rb,
lib/contents_core/engine.rb,
lib/contents_core/version.rb,
app/models/contents_core/item.rb,
app/models/contents_core/block.rb,
app/models/contents_core/item_file.rb,
app/models/contents_core/item_hash.rb,
app/models/contents_core/item_text.rb,
app/models/contents_core/item_array.rb,
app/models/contents_core/item_float.rb,
app/models/contents_core/item_string.rb,
app/models/contents_core/item_boolean.rb,
app/models/contents_core/item_integer.rb,
app/models/contents_core/item_datetime.rb,
app/models/contents_core/application_record.rb

Overview

TODO: needs improvements

Defined Under Namespace

Modules: Blocks Classes: ApplicationRecord, Block, Engine, Item, ItemArray, ItemBoolean, ItemDatetime, ItemFile, ItemFloat, ItemHash, ItemInteger, ItemObject, ItemString, ItemText

Constant Summary collapse

VERSION =
'0.2.5'

Class Method Summary collapse

Class Method Details

.config(options = {}) ⇒ Object



5
6
7
8
# File 'lib/contents_core.rb', line 5

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

.create_block_in_parent(parent, type = :text, params = {}) ⇒ Object



10
11
12
13
14
15
16
17
18
19
# File 'lib/contents_core.rb', line 10

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

.editing(editing = nil) ⇒ Object



21
22
23
24
# File 'lib/contents_core.rb', line 21

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