Module: Rabbit::Format::SpanTextFormatter
- Includes:
- Formatter
- Defined in:
- lib/rabbit/formatter.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #format(text) ⇒ Object
- #html_format(text) ⇒ Object
- #html_formatter? ⇒ Boolean
- #initialize(value) ⇒ Object
- #pango_value ⇒ Object
- #text_formatter? ⇒ Boolean
Methods included from Formatter
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
31 32 33 |
# File 'lib/rabbit/formatter.rb', line 31 def value @value end |
Instance Method Details
#format(text) ⇒ Object
45 46 47 |
# File 'lib/rabbit/formatter.rb', line 45 def format(text) tagged_text(text, "span", {name => pango_value}) end |
#html_format(text) ⇒ Object
49 50 51 |
# File 'lib/rabbit/formatter.rb', line 49 def html_format(text) tagged_text(text, "span", {'style' => "#{css_name}: #{css_value};"}) end |
#html_formatter? ⇒ Boolean
41 42 43 |
# File 'lib/rabbit/formatter.rb', line 41 def html_formatter? true end |
#initialize(value) ⇒ Object
33 34 35 |
# File 'lib/rabbit/formatter.rb', line 33 def initialize(value) @value = value end |
#pango_value ⇒ Object
53 54 55 |
# File 'lib/rabbit/formatter.rb', line 53 def pango_value @value end |
#text_formatter? ⇒ Boolean
37 38 39 |
# File 'lib/rabbit/formatter.rb', line 37 def text_formatter? true end |