Class: I18n::Index::Format::Base
Direct Known Subclasses
Instance Attribute Summary collapse
-
#io ⇒ Object
Returns the value of attribute io.
Instance Method Summary collapse
-
#initialize(io = nil) ⇒ Base
constructor
A new instance of Base.
- #out(str) ⇒ Object
- #setup(target) ⇒ Object
Constructor Details
#initialize(io = nil) ⇒ Base
Returns a new instance of Base.
11 12 13 |
# File 'lib/i18n/index/format.rb', line 11 def initialize(io = nil) self.io = io || $stdout end |
Instance Attribute Details
#io ⇒ Object
Returns the value of attribute io.
9 10 11 |
# File 'lib/i18n/index/format.rb', line 9 def io @io end |
Instance Method Details
#out(str) ⇒ Object
15 16 17 |
# File 'lib/i18n/index/format.rb', line 15 def out(str) io.print(str) end |
#setup(target) ⇒ Object
19 20 21 22 23 |
# File 'lib/i18n/index/format.rb', line 19 def setup(target) $stdout.sync = true (class << target; self; end).send(:include, self.class::Hooks) target.format = self end |