Class: Sevgi::Graphics::Document::Proto

Inherits:
Element
  • Object
show all
Defined in:
lib/sevgi/graphics/document.rb

Overview

Base document root element class.

Direct Known Subclasses

Base

Constant Summary

Constants inherited from Element

Element::RootParent

Instance Attribute Summary

Attributes inherited from Element

#attributes, #children, #contents, #name, #parent

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Element

element, #initialize, #method_missing, #respond_to_missing?, root, root?

Methods included from Element::Ident

#id

Constructor Details

This class inherits a constructor from Sevgi::Graphics::Element

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Sevgi::Graphics::Element

Class Method Details

.attributesHash

Returns inherited root attributes for this document class.

Returns:

  • (Hash)


201
# File 'lib/sevgi/graphics/document.rb', line 201

def self.attributes = self == Proto ? {} : {**superclass.attributes, **profile.attributes}

.preamblesArray<String>?

Returns inherited preamble lines for this document class.

Returns:

  • (Array<String>, nil)


205
# File 'lib/sevgi/graphics/document.rb', line 205

def self.preambles = self == Proto ? nil : profile.preambles || superclass.preambles

Instance Method Details

#call(*objects, **options) ⇒ String

Renders the document.

Parameters:

  • objects (Array<Object>)

    optional renderer arguments

  • options (Hash)

    render options

Returns:

  • (String)

    SVG document source



192
193
194
195
196
197
# File 'lib/sevgi/graphics/document.rb', line 192

def call(*, **)
  options = DEFAULTS.merge(**)

  self.PreRender(*, **options) if respond_to?(:PreRender)
  self.Render(*, **options)
end