Class: Rapid::Model::ListModelObject

Inherits:
Compo::Branches::Array
  • Object
show all
Includes:
CompositeModelObject
Defined in:
lib/ury_rapid/model/composite.rb

Overview

A model object whose children form a list

A ListModelObject stores its children in an Array, with the object IDs being the numeric indices into that Array.

Instance Attribute Summary

Attributes included from ModelObject

#handler_target

Instance Method Summary collapse

Methods included from CompositeModelObject

#get

Methods included from ModelObject

#default_handler_target, #default_id, #flat, #get, #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

Constructor Details

#initialize(handler_target = nil) ⇒ ListModelObject

Returns a new instance of ListModelObject


70
71
72
# File 'lib/ury_rapid/model/composite.rb', line 70

def initialize(handler_target = nil)
  super(handler_target)
end

Instance Method Details

#children_to_get_representation(children_subset, privileges) ⇒ Object


74
75
76
# File 'lib/ury_rapid/model/composite.rb', line 74

def children_to_get_representation(children_subset, privileges)
  children_subset.map { |_, child| child.get(privileges) }
end