Class: Leeno::Model::History
Constant Summary collapse
- FIELDS =
[ :canvas_id, :history_id, :parent_id, :image_large, :image_small, :image_thumb, :create_date, :update_date ]
Instance Method Summary collapse
- #canvas ⇒ Object
- #children ⇒ Object
-
#initialize(data = {}) ⇒ History
constructor
A new instance of History.
- #parent ⇒ Object
Methods inherited from Base
#exclude_options!, #exclude_options?, #include_options!, #to_json
Constructor Details
#initialize(data = {}) ⇒ History
Returns a new instance of History.
15 16 17 18 19 20 |
# File 'lib/leeno/model/history.rb', line 15 def initialize data={} super(data) @canvas = Model::Canvas.new(data["canvas"]) unless data["canvas"].nil? @parent = Model::History.new(data["parent"]) unless data["parent"].nil? @children = Leeno::Array.new(data["children"].map{|h|Model::History.new(h)}) unless data["children"].nil? end |
Instance Method Details
#canvas ⇒ Object
22 23 24 |
# File 'lib/leeno/model/history.rb', line 22 def canvas @canvas ||= Api::Canvas.find(canvas_id) end |