Class: RubyTerraform::MultiIO
- Inherits:
-
Object
- Object
- RubyTerraform::MultiIO
- Defined in:
- lib/ruby_terraform.rb
Instance Method Summary collapse
- #<<(obj) ⇒ Object
- #close ⇒ Object
-
#initialize(*targets) ⇒ MultiIO
constructor
A new instance of MultiIO.
- #reopen(*args) ⇒ Object
- #write(*args) ⇒ Object
Constructor Details
#initialize(*targets) ⇒ MultiIO
Returns a new instance of MultiIO.
1628 1629 1630 |
# File 'lib/ruby_terraform.rb', line 1628 def initialize(*targets) @targets = targets end |
Instance Method Details
#<<(obj) ⇒ Object
1636 1637 1638 1639 |
# File 'lib/ruby_terraform.rb', line 1636 def <<(obj) write(obj) self end |
#close ⇒ Object
1641 1642 1643 1644 |
# File 'lib/ruby_terraform.rb', line 1641 def close @targets.each(&:close) nil end |
#reopen(*args) ⇒ Object
1646 1647 1648 1649 |
# File 'lib/ruby_terraform.rb', line 1646 def reopen(*args) @targets = @targets.collect { |t| t.reopen(*args) } self end |
#write(*args) ⇒ Object
1632 1633 1634 |
# File 'lib/ruby_terraform.rb', line 1632 def write(*args) @targets.collect { |t| t.write(*args) }.max end |