Class: RadioLabel

Inherits:
Shoes::Widget
  • Object
show all
Defined in:
lib/shoes/profiler.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ RadioLabel

Returns a new instance of RadioLabel.



135
136
137
138
139
140
141
142
143
144
# File 'lib/shoes/profiler.rb', line 135

def initialize(options={})
    label = options[:text] || ""
    active = options[:active] || false
    inner_margins = options[:inner_margins] || [0,0,0,0]
    r_margins = inner_margins.dup; r_margins[2] = 5 
    p_margins = [0,3] + inner_margins[2..3]
    
    @r = radio checked: active, margin: r_margins
    @p = para label, margin: p_margins
end

Instance Method Details

#checked=(bool) ⇒ Object



147
# File 'lib/shoes/profiler.rb', line 147

def checked=(bool); @r.checked = bool end

#checked?Boolean

Returns:

  • (Boolean)


146
# File 'lib/shoes/profiler.rb', line 146

def checked?; @r.checked? end