Class: Coradoc::Element::Image::BlockImage

Inherits:
Core
  • Object
show all
Extended by:
AttributeList::Matchers
Defined in:
lib/coradoc/element/image/block_image.rb

Constant Summary collapse

VALIDATORS_NAMED_BLOCK =
{
  caption: String,
  align: one("left", "center", "right"),
  float: one("left", "right"),
}

Constants inherited from Core

Core::VALIDATORS_NAMED, Core::VALIDATORS_POSITIONAL

Instance Attribute Summary

Attributes inherited from Core

#attributes, #id, #src, #title

Instance Method Summary collapse

Methods included from AttributeList::Matchers

many, one

Methods inherited from Core

#to_adoc

Methods inherited from Base

children_accessors, #children_accessors, declare_children, #simplify_block_content, visit, #visit

Constructor Details

#initialize(title, id, src, options = {}) ⇒ BlockImage

Returns a new instance of BlockImage.



5
6
7
8
# File 'lib/coradoc/element/image/block_image.rb', line 5

def initialize(title, id, src, options = {})
  super
  @colons = "::"
end

Instance Method Details

#validate_namedObject



10
11
12
# File 'lib/coradoc/element/image/block_image.rb', line 10

def validate_named
  @attributes.validate_named(VALIDATORS_NAMED, VALIDATORS_NAMED_BLOCK)
end