Class: Fidelity::Widget::Tooltip

Inherits:
Object
  • Object
show all
Defined in:
app/fidelity/widgets/tooltip/tooltip.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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, options={}
  @template = template
end

Instance Attribute Details

#contentObject

Returns the value of attribute content.



5
6
7
# File 'app/fidelity/widgets/tooltip/tooltip.rb', line 5

def content
  @content
end

#templateObject

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 options={}, &block
  @content = Proc.new{ options[:text] }
  @content = template.capture(&block) if block_given?
  ''
end