Class: LinkedData::Client::Models::User

Inherits:
Base
  • Object
show all
Includes:
Collection, ReadWrite
Defined in:
lib/ontologies_api_client/models/user.rb

Constant Summary

Constants included from ReadWrite

ReadWrite::HTTP

Constants inherited from Base

Base::HTTP

Instance Attribute Summary

Attributes inherited from Base

#context, #instance_values, #links

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ReadWrite

#changed_values, #delete, #save, #update, #update_from_params

Methods included from Collection

included

Methods inherited from Base

#[], #[]=, attributes, class_for_type, #explore, #id, #initialize, #marshal_dump, #marshal_load, #method_missing, #respond_to?, #to_hash, #to_jsonld, #type

Constructor Details

This class inherits a constructor from LinkedData::Client::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class LinkedData::Client::Base

Class Method Details

.authenticate(user, password) ⇒ Object



14
15
16
17
# File 'lib/ontologies_api_client/models/user.rb', line 14

def self.authenticate(user, password)
  auth_params = {user: user, password: password, include: "all"}
  LinkedData::Client::HTTP.post("#{LinkedData::Client.settings.rest_url}/users/authenticate", auth_params)
end

Instance Method Details

#admin?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/ontologies_api_client/models/user.rb', line 19

def admin?
  respond_to?(:role) && role.include?("ADMINISTRATOR")
end