class RestfulObjects::CollectionDescription
Attributes
description[RW]
disabled_reason[RW]
friendly_name[RW]
id[R]
member_order[RW]
plural_form[RW]
read_only[R]
type[R]
Public Class Methods
new(id, type, domain_type, options = {})
click to toggle source
# File lib/restful_objects/domain_model/types/collection_description.rb, line 7 def initialize(id, type, domain_type, options = {}) @id = id @type = type @domain_type = domain_type @read_only = options[:read_only].nil? ? false : options[:read_only] @disabled_reason = options[:disabled_reason] || 'read only collection' if read_only @friendly_name = options[:friendly_name] || id @description = options[:description] || id @plural_form = options[:plural_form] @member_order = options[:member_order] end
Public Instance Methods
get_representation()
click to toggle source
# File lib/restful_objects/domain_model/types/collection_description.rb, line 19 def get_representation representation = { 'id' => id, 'memberOrder' => member_order, 'links' => [ link_to(:self, "/domain-types/#{@domain_type}/collections/#{@id}", :collection_description), link_to(:up, "/domain-types/#{@domain_type}", :domain_type), link_to(:return_type, "/domain-types/list", :domain_type), link_to(:element_type, "/domain-types/#{@type}", :domain_type) ], 'extensions' => metadata } representation['friendlyName'] = friendly_name if friendly_name representation['description'] = description if description representation.to_json end
metadata()
click to toggle source
# File lib/restful_objects/domain_model/types/collection_description.rb, line 38 def metadata { 'friendlyName' => friendly_name, 'description' => description, 'returnType' => 'list', 'elementType' => type, 'memberOrder' => member_order, 'pluralForm' => plural_form } end