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.



94
95
96
# File 'lib/lazylead/system/jira.rb', line 94

def initialize(usr)
  @usr = usr
end

Instance Method Details

#==(other) ⇒ Object Also known as: eql?



110
111
112
113
114
115
116
# File 'lib/lazylead/system/jira.rb', line 110

def ==(other)
  if other.respond_to?(:id)
    other.id == id
  else
    false
  end
end

#emailObject



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

def email
  @usr["emailAddress"]
end

#hashObject



120
121
122
# File 'lib/lazylead/system/jira.rb', line 120

def hash
  id.hash
end

#idObject



98
99
100
# File 'lib/lazylead/system/jira.rb', line 98

def id
  @usr["name"]
end

#inspectObject



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

def inspect
  "#{@opts['site']} (#{@opts['username']})"
end

#nameObject



102
103
104
# File 'lib/lazylead/system/jira.rb', line 102

def name
  @usr["displayName"]
end

#to_sObject



124
125
126
# File 'lib/lazylead/system/jira.rb', line 124

def to_s
  inspect
end