Sha256: b0cd042cb3a18b42479a6471d7ec888d0948caee87f7d380e6f18e7f9c50d3a1

Contents?: true

Size: 425 Bytes

Versions: 34

Compression:

Stored size: 425 Bytes

Contents

module Workarea
  class Content
    class BlockTypeDefinition
      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?
          Workarea.config.content_block_types.push(block_type)
        end
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
workarea-core-3.4.45 app/models/workarea/content/block_type_definition.rb
workarea-core-3.4.44 app/models/workarea/content/block_type_definition.rb
workarea-core-3.4.43 app/models/workarea/content/block_type_definition.rb
workarea-core-3.4.42 app/models/workarea/content/block_type_definition.rb
workarea-core-3.4.41 app/models/workarea/content/block_type_definition.rb
workarea-core-3.4.40 app/models/workarea/content/block_type_definition.rb
workarea-core-3.4.39 app/models/workarea/content/block_type_definition.rb
workarea-core-3.4.38 app/models/workarea/content/block_type_definition.rb
workarea-core-3.4.37 app/models/workarea/content/block_type_definition.rb
workarea-core-3.4.36 app/models/workarea/content/block_type_definition.rb
workarea-core-3.4.35 app/models/workarea/content/block_type_definition.rb
workarea-core-3.4.34 app/models/workarea/content/block_type_definition.rb
workarea-core-3.4.33 app/models/workarea/content/block_type_definition.rb
workarea-core-3.4.32 app/models/workarea/content/block_type_definition.rb
workarea-core-3.4.31 app/models/workarea/content/block_type_definition.rb
workarea-core-3.4.30 app/models/workarea/content/block_type_definition.rb
workarea-core-3.4.29 app/models/workarea/content/block_type_definition.rb
workarea-core-3.4.28 app/models/workarea/content/block_type_definition.rb
workarea-core-3.4.27 app/models/workarea/content/block_type_definition.rb
workarea-core-3.4.26 app/models/workarea/content/block_type_definition.rb