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.
- #obj ⇒ Object
- #obj=(obj) ⇒ Object
- #remove ⇒ Object
Constructor Details
#initialize(name = nil, attributes: {}, rexle: nil) ⇒ Box
Returns a new instance of Box.
106 107 108 109 110 111 112 |
# File 'lib/shul.rb', line 106 def initialize(name=nil, attributes: {}, rexle: nil) name = self.class.to_s[/\w+$/].downcase super(name, attributes: attributes, rexle: rexle) @obj = nil end |
Instance Method Details
#append_child(obj) ⇒ Object
114 115 116 117 118 119 120 121 |
# File 'lib/shul.rb', line 114 def append_child(obj) node = self.add obj @rexle.callback.add_element(node) if @rexle.callback return node end |
#deep_clone ⇒ Object
123 124 125 126 127 |
# File 'lib/shul.rb', line 123 def deep_clone() Shule.new(self.xml, rexle: @rexle).root end |
#obj ⇒ Object
129 |
# File 'lib/shul.rb', line 129 def obj() @obj end |
#obj=(obj) ⇒ Object
130 |
# File 'lib/shul.rb', line 130 def obj=(obj) @obj = obj end |
#remove ⇒ Object
132 133 134 135 136 137 |
# File 'lib/shul.rb', line 132 def remove() @rexle.callback.remove_element(self) if @rexle.callback self.delete end |