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.



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_cloneObject



123
124
125
126
127
# File 'lib/shul.rb', line 123

def deep_clone() 

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

end

#objObject



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

#removeObject



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