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.



173
174
175
176
177
178
# File 'lib/shul.rb', line 173

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



180
181
182
183
184
# File 'lib/shul.rb', line 180

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