Method: PureCloud::Workspace#initialize
- Defined in:
- lib/purecloud/models/workspace.rb
#initialize(attributes = {}) ⇒ Workspace
Returns a new instance of Workspace.
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 |
# File 'lib/purecloud/models/workspace.rb', line 94 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo} if attributes[:'id'] self.id = attributes[:'id'] end if attributes[:'name'] self.name = attributes[:'name'] end if attributes[:'type'] self.type = attributes[:'type'] end if attributes[:'isCurrentUserWorkspace'] self.is_current_user_workspace = attributes[:'isCurrentUserWorkspace'] else self.is_current_user_workspace = false end if attributes[:'user'] self.user = attributes[:'user'] end if attributes[:'bucket'] self.bucket = attributes[:'bucket'] end if attributes[:'dateCreated'] self.date_created = attributes[:'dateCreated'] end if attributes[:'dateModified'] self.date_modified = attributes[:'dateModified'] end if attributes[:'summary'] self.summary = attributes[:'summary'] end if attributes[:'acl'] if (value = attributes[:'acl']).is_a?(Array) self.acl = value end end if attributes[:'selfUri'] self.self_uri = attributes[:'selfUri'] end end |