Method: ActiveCMIS::Repository#type_by_id

Defined in:
lib/active_cmis/repository.rb

#type_by_id(id) ⇒ Class

Finds the type with a given ID in the repository

Returns:

  • (Class)


124
125
126
127
128
129
130
131
132
133
134
135
# File 'lib/active_cmis/repository.rb', line 124

def type_by_id(id)
  @type_by_id ||= {}
  if result = @type_by_id[id]
    result
  else
    template = pick_template("typebyid")
    raise "Repository does not define required URI-template 'typebyid'" unless template
    url = fill_in_template(template, "id" => id)

    @type_by_id[id] = Type.create(conn, self, conn.get_atom_entry(url))
  end
end