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.



103
104
105
106
107
108
109
# File 'lib/shul.rb', line 103

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



111
112
113
114
115
116
117
118
# File 'lib/shul.rb', line 111

def append_child(obj)

  node = self.add obj

  @rexle.callback.add_element(node) if @rexle.callback
  
  return node
end

#deep_cloneObject



120
121
122
123
124
# File 'lib/shul.rb', line 120

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
# File 'lib/shul.rb', line 132

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