Sha256: d2a046314058d396931210ce19c1dc0badf8fc271c1795d4c16984d01aeb8809

Contents?: true

Size: 982 Bytes

Versions: 4

Compression:

Stored size: 982 Bytes

Contents

module CSL
  class Style
    
    # The Group rendering element must contain one or more rendering
    # element (with the exception of {Layout}). Group nodes may carry the
    # delimiter attribute to separate their child elements, as well as
    # affixes and display attributes (applied to the output of the group
    # as a whole) and formatting attributes (transmitted to the enclosed
    # elements).
    #
    # Groups implicitly act as a conditionals: a Group and its child
    # elements are suppressed if a) at least one rendering element in
    # the Group calls a variable (either directly or via a macro), and
    # b) all variables that are called are empty.
    class Group < Node
      attr_struct(*Schema.attr(:formatting, :affixes, :display, :delimiter))
      
      def delimiter
        attributes.fetch(:delimiter, '')
      end

      private
      
      def added_child(node)
        node.attributes.merge formatting_options
      end
    end
    
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
csl-1.0.0.pre23 lib/csl/style/group.rb
csl-1.0.0.pre22 lib/csl/style/group.rb
csl-1.0.0.pre21 lib/csl/style/group.rb
csl-1.0.0.pre20 lib/csl/style/group.rb