Class: Lazylead::User
- Inherits:
-
Object
- Object
- Lazylead::User
- Defined in:
- lib/lazylead/system/jira.rb
Overview
An user from Jira which might be reporter, assignee, etc.
- Author
-
Yurii Dubinka ([email protected])
- Copyright
-
Copyright © 2019-2020 Yurii Dubinka
- License
-
MIT
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #email ⇒ Object
- #hash ⇒ Object
- #id ⇒ Object
-
#initialize(usr) ⇒ User
constructor
A new instance of User.
- #name ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(usr) ⇒ User
Returns a new instance of User.
101 102 103 |
# File 'lib/lazylead/system/jira.rb', line 101 def initialize(usr) @usr = usr end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
117 118 119 120 121 122 123 |
# File 'lib/lazylead/system/jira.rb', line 117 def ==(other) if other.respond_to?(:id) other.id == id else false end end |
#email ⇒ Object
113 114 115 |
# File 'lib/lazylead/system/jira.rb', line 113 def email @usr["emailAddress"] end |
#hash ⇒ Object
127 128 129 |
# File 'lib/lazylead/system/jira.rb', line 127 def hash id.hash end |
#id ⇒ Object
105 106 107 |
# File 'lib/lazylead/system/jira.rb', line 105 def id @usr["name"] end |
#name ⇒ Object
109 110 111 |
# File 'lib/lazylead/system/jira.rb', line 109 def name @usr["displayName"] end |
#to_s ⇒ Object
131 132 133 |
# File 'lib/lazylead/system/jira.rb', line 131 def to_s "#{name} (#{id})" end |