Module: Rabbit::Format::SpanTextFormatter

Includes:
Formatter
Defined in:
lib/rabbit/formatter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Formatter

#tagged_text

Instance Attribute Details

#valueObject (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

Returns:

  • (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_valueObject


53
54
55
# File 'lib/rabbit/formatter.rb', line 53

def pango_value
  @value
end

#text_formatter?Boolean

Returns:

  • (Boolean)

37
38
39
# File 'lib/rabbit/formatter.rb', line 37

def text_formatter?
  true
end