Method: CmisServer::PropertyDefinition#initialize

Defined in:
lib/cmis_server/property_definition.rb

#initialize(attrs = {}) ⇒ PropertyDefinition

Returns a new instance of PropertyDefinition.



60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/cmis_server/property_definition.rb', line 60

def initialize(attrs={})
  self.id              = CmisServer::Id.new(attrs.fetch(:id).to_s)
  self.local_name      = attrs.fetch(:local_name, id)
  self.local_namespace = attrs.fetch(:local_namespace, 'local')
  self.query_name      = attrs.fetch(:query_name, id)
  self.display_name    = attrs.fetch(:display_name, id)
  self.description     = attrs.fetch(:description, "No description provided")
  self.property_type   = attrs.fetch(:property_type, nil)
  self.cardinality     = attrs.fetch(:cardinality, :single)
  self.updatability    = attrs.fetch(:updatability, :readonly)
  self.required        = attrs.fetch(:required, false)
  self.queryable       = attrs.fetch(:queryable, false)
  self.orderable       = attrs.fetch(:orderable, false)
  self.choices         = attrs.fetch(:choices, nil)
  self.open_choice     = attrs.fetch(:open_choice, false)
  self.default_value   = attrs.fetch(:default_value, nil)
  self.value           = attrs.fetch(:value, nil)
  self.type            = attrs.fetch(:type, nil)
end