Class: Ooz::Base::Model

Inherits:
Common::BaseModel show all
Defined in:
lib/ooz/base/model.rb

Instance Attribute Summary collapse

Attributes inherited from Common::BaseModel

#doc

Instance Method Summary collapse

Methods inherited from Common::BaseModel

#as_json, #as_update, build, #changed?, #consolidate!, #new_change?, #print, #to_json, #undo!, #update_last_change!

Methods inherited from Common::BaseClass

overridable_const, passthrough, passthrough_arr, passthrough_cls

Constructor Details

#initialize(*args, root: nil) ⇒ Model

Returns a new instance of Model.



7
8
9
10
# File 'lib/ooz/base/model.rb', line 7

def initialize(*args, root: nil)
  super(*args)
  @root = root
end

Instance Attribute Details

#rootObject (readonly)

Returns the value of attribute root.



5
6
7
# File 'lib/ooz/base/model.rb', line 5

def root
  @root
end

Instance Method Details

#oozeObject



12
13
14
# File 'lib/ooz/base/model.rb', line 12

def ooze
  self.is_a?(Ooze)? self : root && root.ooze
end