Class: Tcl::Msgcat::Renderer
- Inherits:
-
Object
- Object
- Tcl::Msgcat::Renderer
- Defined in:
- lib/tcl/msgcat/renderer.rb
Instance Attribute Summary collapse
-
#lines ⇒ Object
readonly
Returns the value of attribute lines.
-
#msgs ⇒ Object
readonly
Returns the value of attribute msgs.
Instance Method Summary collapse
-
#initialize(msgs) ⇒ Renderer
constructor
A new instance of Renderer.
- #render ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(msgs) ⇒ Renderer
Returns a new instance of Renderer.
5 6 7 8 |
# File 'lib/tcl/msgcat/renderer.rb', line 5 def initialize(msgs) @msgs = msgs @lines = [] end |
Instance Attribute Details
#lines ⇒ Object (readonly)
Returns the value of attribute lines.
4 5 6 |
# File 'lib/tcl/msgcat/renderer.rb', line 4 def lines @lines end |
#msgs ⇒ Object (readonly)
Returns the value of attribute msgs.
4 5 6 |
# File 'lib/tcl/msgcat/renderer.rb', line 4 def msgs @msgs end |
Instance Method Details
#render ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/tcl/msgcat/renderer.rb', line 10 def render @lines << "package require mchelper" @lines << "msg_lang {}" @lines << "" _render(@msgs) self end |
#to_s ⇒ Object
19 20 21 |
# File 'lib/tcl/msgcat/renderer.rb', line 19 def to_s @lines.join("\n") end |