Class: Sevgi::Graphics::Profile
- Inherits:
-
Object
- Object
- Sevgi::Graphics::Profile
- Defined in:
- lib/sevgi/graphics/auxilary/profile.rb
Defined Under Namespace
Modules: DSL
Class Attribute Summary collapse
-
.available ⇒ Object
readonly
Returns the value of attribute available.
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#preambles ⇒ Object
readonly
Returns the value of attribute preambles.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name, attributes: nil, preambles: nil) ⇒ Profile
constructor
A new instance of Profile.
Constructor Details
#initialize(name, attributes: nil, preambles: nil) ⇒ Profile
Returns a new instance of Profile.
22 23 24 25 26 |
# File 'lib/sevgi/graphics/auxilary/profile.rb', line 22 def initialize(name, attributes: nil, preambles: nil) @name = name @attributes = attributes || {} @preambles = preambles end |
Class Attribute Details
.available ⇒ Object (readonly)
Returns the value of attribute available.
9 10 11 |
# File 'lib/sevgi/graphics/auxilary/profile.rb', line 9 def available @available end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
20 21 22 |
# File 'lib/sevgi/graphics/auxilary/profile.rb', line 20 def attributes @attributes end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
20 21 22 |
# File 'lib/sevgi/graphics/auxilary/profile.rb', line 20 def name @name end |
#preambles ⇒ Object (readonly)
Returns the value of attribute preambles.
20 21 22 |
# File 'lib/sevgi/graphics/auxilary/profile.rb', line 20 def preambles @preambles end |
Class Method Details
.[](name) ⇒ Object
17 |
# File 'lib/sevgi/graphics/auxilary/profile.rb', line 17 def [](name) = available[name] |
.call(document, canvas = nil, &block) ⇒ Object
11 12 13 |
# File 'lib/sevgi/graphics/auxilary/profile.rb', line 11 def call(document, canvas = nil, **, &block) (klass = self[document]).root(**klass.attributes, **(canvas ? Canvas.(canvas).attributes : {}), **, &block) end |
.register(name, klass) ⇒ Object
15 |
# File 'lib/sevgi/graphics/auxilary/profile.rb', line 15 def register(name, klass) = (available[name] = klass) |