Class: Shul::Shule::Box

Inherits:
Element
  • Object
show all
Defined in:
lib/shul.rb

Direct Known Subclasses

Component, Hbox, Vbox

Instance Method Summary collapse

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_cloneObject



128
129
130
131
132
# File 'lib/shul.rb', line 128

def deep_clone() 

  Shule.new(self.xml, rexle: @rexle).root

end

#removeObject



134
135
136
137
# File 'lib/shul.rb', line 134

def remove()
  @rexle.callback.remove_element(self) if @rexle.callback
  self.delete   
end