Class: Archimate::MaybeIO
- Inherits:
-
Object
- Object
- Archimate::MaybeIO
- Defined in:
- lib/archimate/maybe_io.rb
Instance Method Summary collapse
-
#initialize(filename) {|the| ... } ⇒ MaybeIO
constructor
Creates a MaybeIO object passing it yielding it to the given block.
-
#write(_str) ⇒ Object
Implementation of the NilIO write method - effectively passes the input String to /dev/null.
Constructor Details
#initialize(filename) {|the| ... } ⇒ MaybeIO
Creates a MaybeIO object passing it yielding it to the given block
19 20 21 22 23 24 25 26 27 |
# File 'lib/archimate/maybe_io.rb', line 19 def initialize(filename) if filename.nil? yield self else File.open(filename, "w") do |io| yield io end end end |
Instance Method Details
#write(_str) ⇒ Object
Implementation of the NilIO write method - effectively passes the input String to /dev/null
33 |
# File 'lib/archimate/maybe_io.rb', line 33 def write(_str); end |