Class: Fidelity::Widget::Tooltip
- Inherits:
-
Object
- Object
- Fidelity::Widget::Tooltip
- Defined in:
- app/fidelity/widgets/tooltip/tooltip.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
-
#template ⇒ Object
Returns the value of attribute template.
Instance Method Summary collapse
-
#initialize(template, options = {}) ⇒ Tooltip
constructor
A new instance of Tooltip.
- #tip(options = {}, &block) ⇒ Object
Constructor Details
#initialize(template, options = {}) ⇒ Tooltip
Returns a new instance of Tooltip.
6 7 8 |
# File 'app/fidelity/widgets/tooltip/tooltip.rb', line 6 def initialize template, ={} @template = template end |
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content.
5 6 7 |
# File 'app/fidelity/widgets/tooltip/tooltip.rb', line 5 def content @content end |
#template ⇒ Object
Returns the value of attribute template.
5 6 7 |
# File 'app/fidelity/widgets/tooltip/tooltip.rb', line 5 def template @template end |
Instance Method Details
#tip(options = {}, &block) ⇒ Object
10 11 12 13 14 |
# File 'app/fidelity/widgets/tooltip/tooltip.rb', line 10 def tip ={}, &block @content = Proc.new{ [:text] } @content = template.capture(&block) if block_given? '' end |