Sha256: 3b997ecf058c9ce26b68573416a682b56bce37cddaee68820f9cf756212f4c8d

Contents?: true

Size: 499 Bytes

Versions: 22

Compression:

Stored size: 499 Bytes

Contents

module Workarea
  class Content
    class BlockTypeDefinition
      def self.define(&block)
        new.instance_eval(&block)
      end

      def block_type(name, &block)
        block_type = BlockType.new(name)

        if existing = BlockType.find(block_type.slug)
          existing.instance_eval(&block) if block_given?
        else
          block_type.instance_eval(&block) if block_given?
          Configuration::ContentBlocks.types.push(block_type)
        end
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
workarea-core-3.5.27 app/models/workarea/content/block_type_definition.rb
workarea-core-3.5.26 app/models/workarea/content/block_type_definition.rb
workarea-core-3.5.25 app/models/workarea/content/block_type_definition.rb
workarea-core-3.5.23 app/models/workarea/content/block_type_definition.rb
workarea-core-3.5.22 app/models/workarea/content/block_type_definition.rb
workarea-core-3.5.21 app/models/workarea/content/block_type_definition.rb
workarea-core-3.5.20 app/models/workarea/content/block_type_definition.rb
workarea-core-3.5.19 app/models/workarea/content/block_type_definition.rb
workarea-core-3.5.18 app/models/workarea/content/block_type_definition.rb
workarea-core-3.5.17 app/models/workarea/content/block_type_definition.rb
workarea-core-3.5.16 app/models/workarea/content/block_type_definition.rb
workarea-core-3.5.15 app/models/workarea/content/block_type_definition.rb
workarea-core-3.5.14 app/models/workarea/content/block_type_definition.rb
workarea-core-3.5.13 app/models/workarea/content/block_type_definition.rb
workarea-core-3.5.12 app/models/workarea/content/block_type_definition.rb
workarea-core-3.5.11 app/models/workarea/content/block_type_definition.rb
workarea-core-3.5.10 app/models/workarea/content/block_type_definition.rb
workarea-core-3.5.9 app/models/workarea/content/block_type_definition.rb
workarea-core-3.5.8 app/models/workarea/content/block_type_definition.rb
workarea-core-3.5.7 app/models/workarea/content/block_type_definition.rb