Class: Lazylead::User

Inherits:
Object
  • Object
show all
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

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

#emailObject



113
114
115
# File 'lib/lazylead/system/jira.rb', line 113

def email
  @usr["emailAddress"]
end

#hashObject



127
128
129
# File 'lib/lazylead/system/jira.rb', line 127

def hash
  id.hash
end

#idObject



105
106
107
# File 'lib/lazylead/system/jira.rb', line 105

def id
  @usr["name"]
end

#nameObject



109
110
111
# File 'lib/lazylead/system/jira.rb', line 109

def name
  @usr["displayName"]
end

#to_sObject



131
132
133
# File 'lib/lazylead/system/jira.rb', line 131

def to_s
  "#{name} (#{id})"
end