Class: Brandish::Processors::Common::Group Abstract

Inherits:
Brandish::Processor::Base show all
Includes:
Brandish::Processor::Block
Defined in:
lib/brandish/processors/common/group.rb

Overview

This class is abstract.

A "group." This is for grouping together elements for styling or logical purposes. By default, this creates a block element.

This takes no options.

Pairs:

Direct Known Subclasses

HTML::Group

Instance Attribute Summary

Attributes inherited from Brandish::Processor::Base

#context

Instance Method Summary collapse

Methods included from Brandish::Processor::Block

included, #perform, #process_block

Methods inherited from Brandish::Processor::Base

#accept, #call, #initialize, #postprocess, #process_block, #process_command, #process_root, #process_text, register, #setup

Constructor Details

This class inherits a constructor from Brandish::Processor::Base

Instance Method Details

#accepted_body::String

The body, accepted and flattened. This essentially converts the contents into a string that can be used as the value for the group.



61
62
63
# File 'lib/brandish/processors/common/group.rb', line 61

def accepted_body
  accept(@body).flatten
end

#class_value::String

The class value of the group. This can have a 1-to-1 correspondence to the destination source. This works similarly to HTML's class attribute. This uses the "class" pair.

Returns:

  • (::String)


31
32
33
# File 'lib/brandish/processors/common/group.rb', line 31

def class_value
  @pairs.fetch("class", "")
end

#id_value::String?

The ID value of the group. This can have a 1-to-1 correspondence to the destination source. This works similarly to HTML's id attribute; especially the concept that it should be unique. This uses the "id" pair.

Returns:

  • (::String, nil)


41
42
43
# File 'lib/brandish/processors/common/group.rb', line 41

def id_value
  @pairs["id"]
end

#name_value::String?

The name value of the group. This doesn't have a 1-to-1 correspondence to the destination source. This is used to provide an internal styling or grouping process. This uses the "name" pair.

Returns:

  • (::String, nil)


51
52
53
# File 'lib/brandish/processors/common/group.rb', line 51

def name_value
  @pairs["name"]
end