Class: Shul::Shule::Box
- Inherits:
-
Element
- Object
- Element
- Shul::Shule::Box
- Defined in:
- lib/shul.rb
Instance Method Summary collapse
- #append_child(obj) ⇒ Object
- #deep_clone ⇒ Object
-
#initialize(name = nil, attributes: {}, rexle: nil) ⇒ Box
constructor
A new instance of Box.
- #remove ⇒ Object
Constructor Details
#initialize(name = nil, attributes: {}, rexle: nil) ⇒ Box
Returns a new instance of Box.
115 116 117 118 119 |
# File 'lib/shul.rb', line 115 def initialize(name=nil, attributes: {}, rexle: nil) name = self.class.to_s[/\w+$/].downcase super(name, attributes: attributes, rexle: rexle) end |
Instance Method Details
#append_child(obj) ⇒ Object
121 122 123 124 125 126 |
# File 'lib/shul.rb', line 121 def append_child(obj) node = self.add obj @rexle.callback.add_element(node) if @rexle.callback end |
#deep_clone ⇒ Object
128 129 130 131 132 |
# File 'lib/shul.rb', line 128 def deep_clone() Shule.new(self.xml, rexle: @rexle).root end |
#remove ⇒ Object
134 135 136 137 |
# File 'lib/shul.rb', line 134 def remove() @rexle.callback.remove_element(self) if @rexle.callback self.delete end |