Created
July 7, 2011 06:00
-
-
Save jefftrull/1068965 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Cell < ActiveRecord::Base | |
composed_of :extent, :class_name => "Vector", :mapping => %w(extent_x extent_y extent_z), :constructor => Proc.new { |x,y,z| Vector.elements([x, y, z]) } | |
def as_json(options={}) | |
{:name => self.name, :id => self.id, :extent => [self.extent_x, self.extent_y, self.extent_z]} | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment