Class: RubyCraft::Region::RegionWritter

Inherits:
Object
  • Object
show all
Defined in:
lib/rubycraft/region.rb

Instance Method Summary collapse

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

#closeObject



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