Class: RubyCraft::Region::RegionWritter
- Inherits:
-
Object
- Object
- RubyCraft::Region::RegionWritter
- Defined in:
- lib/rubycraft/region.rb
Instance Method Summary collapse
- #<<(o) ⇒ Object
- #close ⇒ Object
-
#initialize(io) ⇒ RegionWritter
constructor
A new instance of RegionWritter.
- #pad(count, value = 0) ⇒ Object
Constructor Details
#initialize(io) ⇒ RegionWritter
Returns a new instance of RegionWritter.
67 68 69 |
# File 'lib/rubycraft/region.rb', line 67 def initialize(io) @io = io end |
Instance Method Details
#<<(o) ⇒ Object
75 76 77 78 |
# File 'lib/rubycraft/region.rb', line 75 def <<(o) input = o.kind_of?(Array) ? o : [o] @io << ByteConverter.toByteString(input) end |
#close ⇒ Object
80 81 82 |
# File 'lib/rubycraft/region.rb', line 80 def close @io.close end |
#pad(count, value = 0) ⇒ Object
71 72 73 |
# File 'lib/rubycraft/region.rb', line 71 def pad(count, value = 0) self << Array.new(count) { value } end |