Class: BoringAvatars::Svg::Element
- Inherits:
-
Data
- Object
- Data
- BoringAvatars::Svg::Element
- Defined in:
- lib/boring_avatars/svg/element.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#children ⇒ Object
readonly
Returns the value of attribute children.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name:, attributes: {}, children: []) ⇒ Element
constructor
A new instance of Element.
Constructor Details
#initialize(name:, attributes: {}, children: []) ⇒ Element
Returns a new instance of Element.
6 7 8 9 10 11 12 |
# File 'lib/boring_avatars/svg/element.rb', line 6 def initialize(name:, attributes: {}, children: []) super( name: name.to_s.freeze, attributes: attributes.reject { |_key, value| value.nil? }.freeze, children: children.freeze ) end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes
5 6 7 |
# File 'lib/boring_avatars/svg/element.rb', line 5 def attributes @attributes end |
#children ⇒ Object (readonly)
Returns the value of attribute children
5 6 7 |
# File 'lib/boring_avatars/svg/element.rb', line 5 def children @children end |
#name ⇒ Object (readonly)
Returns the value of attribute name
5 6 7 |
# File 'lib/boring_avatars/svg/element.rb', line 5 def name @name end |