Class: JCF::CF::User
Instance Attribute Summary collapse
-
#guid ⇒ Object
Returns the value of attribute guid.
-
#presentation_name ⇒ Object
Returns the value of attribute presentation_name.
-
#raw ⇒ Object
Returns the value of attribute raw.
-
#username ⇒ Object
Returns the value of attribute username.
Attributes inherited from Base
Class Method Summary collapse
Instance Method Summary collapse
- #attributes ⇒ Object
-
#initialize(username: nil, guid: nil, presentation_name: nil) ⇒ User
constructor
A new instance of User.
Methods inherited from Base
all, find, find_by, first, format, keys, #keys, #populate!, resource_url, #to_s, #values
Constructor Details
#initialize(username: nil, guid: nil, presentation_name: nil) ⇒ User
Returns a new instance of User.
16 17 18 19 20 21 |
# File 'lib/jcf/cf/user.rb', line 16 def initialize(username: nil, guid: nil, presentation_name: nil) super() @username = username @guid = guid @presentation_name = presentation_name end |
Instance Attribute Details
#guid ⇒ Object
Returns the value of attribute guid.
8 9 10 |
# File 'lib/jcf/cf/user.rb', line 8 def guid @guid end |
#presentation_name ⇒ Object
Returns the value of attribute presentation_name.
8 9 10 |
# File 'lib/jcf/cf/user.rb', line 8 def presentation_name @presentation_name end |
#raw ⇒ Object
Returns the value of attribute raw.
8 9 10 |
# File 'lib/jcf/cf/user.rb', line 8 def raw @raw end |
#username ⇒ Object
Returns the value of attribute username.
8 9 10 |
# File 'lib/jcf/cf/user.rb', line 8 def username @username end |
Class Method Details
.populate_objects(hash) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/jcf/cf/user.rb', line 23 def self.populate_objects(hash) hash[:resources].map! do |object| o = new( guid: object[:guid], username: object[:username], presentation_name: object[:presentation_name] ) o end rescue NoMethodError puts "object is #{hash[:resources]}" end |
Instance Method Details
#attributes ⇒ Object
12 13 14 |
# File 'lib/jcf/cf/user.rb', line 12 def attributes { username: username, guid: guid, presentation_name: presentation_name } end |