dmendel/bindata — pull request #33 by jlukas (2014-03-20 00:49:18+00:00)
Title: Add :both endian option

Add `:both` endian option. This allows you to write one class that handles both little and big endian structures. Example:

```ruby
class Vector < BinData::Record
endian :both
uint16 :x
uint16 :y
uint16 :z
end

class Ray < BinData::Record
endian :both
vector :location
vector :direction
end

Ray.endian # => :both
Ray.new(endian: :little).class.endian # => :little
```

As a side note, subclassing an `endian :both` class does not work as expected.