Class: Shul::Shule::Radiogroup

Inherits:
Component show all
Defined in:
lib/shul.rb

Instance Method Summary collapse

Methods inherited from Box

#append_child, #deep_clone, #obj, #obj=, #remove

Constructor Details

#initialize(name = 'radiogroup', attributes: nil, rexle: nil) ⇒ Radiogroup

Returns a new instance of Radiogroup.



176
177
178
179
180
181
# File 'lib/shul.rb', line 176

def initialize(name='radiogroup', attributes: nil, rexle: nil)

  h = {value: ''}
  h.merge!(attributes) if attributes
  super(name, attributes: VisualAttributes.new(h), rexle: rexle)
end

Instance Method Details

#append_item(label, value) ⇒ Object



183
184
185
186
187
# File 'lib/shul.rb', line 183

def append_item(label, value)
  
  self.add @rexle.create_element('radio', label: label, value: value)
  
end