Class: Duse::Client::User

Inherits:
Entity
  • Object
show all
Defined in:
lib/duse/client/user.rb

Constant Summary

Constants inherited from Entity

Entity::MAP

Instance Attribute Summary

Attributes inherited from Entity

#attributes, #curry

Instance Method Summary collapse

Methods inherited from Entity

add_attribute, attributes, base_path, #delete, id_field, ignore_in_json, #initialize, #load_attribute, many, #missing?, one, #reload, #save, #set_attribute, subclasses, #to_h

Constructor Details

This class inherits a constructor from Duse::Client::Entity

Instance Method Details

#public_keyObject



13
14
15
# File 'lib/duse/client/user.rb', line 13

def public_key
  OpenSSL::PKey::RSA.new load_attribute 'public_key'
end

#public_key=(public_key) ⇒ Object



17
18
19
20
# File 'lib/duse/client/user.rb', line 17

def public_key=(public_key)
  public_key = public_key.to_s if public_key.is_a? OpenSSL::PKey::RSA
  set_attribute('public_key', public_key)
end

#server?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/duse/client/user.rb', line 22

def server?
  'server' == self.username
end