Module: Relevant::Widget::ClassMethods
- Defined in:
- lib/relevant/widget.rb
Instance Method Summary collapse
- #_default_label ⇒ Object
- #available_options(options = nil) ⇒ Object
- #label(the_label = _default_label) ⇒ Object
- #refresh_every(seconds = nil) ⇒ Object
- #setup(options = {}) ⇒ Object
- #template(data = nil) ⇒ Object
- #template_format(format = nil) ⇒ Object
Instance Method Details
#_default_label ⇒ Object
48 49 50 |
# File 'lib/relevant/widget.rb', line 48 def _default_label name.demodulize.gsub(/[[A-Z]]/, ' \0').strip end |
#available_options(options = nil) ⇒ Object
28 29 30 |
# File 'lib/relevant/widget.rb', line 28 def ( = nil) .nil? ? @available_options : (@available_options = ) end |
#label(the_label = _default_label) ⇒ Object
44 45 46 |
# File 'lib/relevant/widget.rb', line 44 def label(the_label = _default_label) @label ||= the_label end |
#refresh_every(seconds = nil) ⇒ Object
40 41 42 |
# File 'lib/relevant/widget.rb', line 40 def refresh_every(seconds = nil) seconds.nil? ? @refresh_every : (@refresh_every = seconds) end |
#setup(options = {}) ⇒ Object
21 22 23 24 25 26 |
# File 'lib/relevant/widget.rb', line 21 def setup( = {}) = new . = .reject{|key,val| val.blank?} end |
#template(data = nil) ⇒ Object
36 37 38 |
# File 'lib/relevant/widget.rb', line 36 def template(data = nil) data.nil? ? @template : (@template = data) end |
#template_format(format = nil) ⇒ Object
32 33 34 |
# File 'lib/relevant/widget.rb', line 32 def template_format(format = nil) format.nil? ? @template_format : (@template_format = format) end |