Class: RHC::Rest::User
Direct Known Subclasses
Instance Method Summary collapse
- #add_key(name, content, type) ⇒ Object
- #capabilities ⇒ Object
-
#find_key(name) ⇒ Object
Find Key by name.
- #keys ⇒ Object
- #max_domains ⇒ Object
Methods inherited from Base
#add_message, #has_param?, #initialize, #link_href, #links, #rest_method, #supports?
Methods included from AttributesClass
Methods included from Attributes
#attribute, #attributes, #attributes=, #clear_attribute
Constructor Details
This class inherits a constructor from RHC::Rest::Base
Instance Method Details
#add_key(name, content, type) ⇒ Object
8 9 10 11 |
# File 'lib/rhc/rest/user.rb', line 8 def add_key(name, content, type) debug "Add key #{name} of type #{type} for user #{login}" rest_method "ADD_KEY", :name => name, :type => type, :content => content end |
#capabilities ⇒ Object
27 28 29 |
# File 'lib/rhc/rest/user.rb', line 27 def capabilities @capabilities ||= OpenStruct.new attribute('capabilities') end |
#find_key(name) ⇒ Object
Find Key by name
19 20 21 |
# File 'lib/rhc/rest/user.rb', line 19 def find_key(name) keys.detect { |key| key.name == name } end |
#keys ⇒ Object
13 14 15 16 |
# File 'lib/rhc/rest/user.rb', line 13 def keys debug "Getting all keys for user #{login}" rest_method "LIST_KEYS" end |
#max_domains ⇒ Object
23 24 25 |
# File 'lib/rhc/rest/user.rb', line 23 def max_domains attributes['max_domains'] || 1 end |