Module: Rapid::Model::CompositeModelObject

Extended by:
Forwardable
Includes:
ModelObject
Included in:
HashModelObject, ListModelObject
Defined in:
lib/ury_rapid/model/composite.rb

Overview

A model object which contains children

This should be subclassed to provide the actual child structure (hash, array, et cetera).

CompositeModelObjects should export the Enumerable interface, which forwards to the children container.

Instance Attribute Summary

Attributes included from ModelObject

#handler_target

Instance Method Summary collapse

Methods included from ModelObject

#default_handler_target, #default_id, #flat, #initialize, #insert, #kill, #post_to_parent, #register_handler, #replace

Methods included from Updatable

#deregister_from_updates, #notify_delete, #notify_update, #register_for_updates, #register_update_channel

Instance Method Details

#get(privileges) ⇒ Object

GETs this model object as a 'flat' representation

Flat representations contain only primitive objects (integers, strings, etc.) and lists and hashes.

In a flat representation, children requiring privileges the caller does not have are hidden.


34
35
36
# File 'lib/ury_rapid/model/composite.rb', line 34

def get(privileges)
  children_to_get_representation(reachable(:get, privileges), privileges)
end