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.



111
112
113
# File 'lib/lazylead/system/jira.rb', line 111

def initialize(usr)
  @usr = usr
end

Instance Method Details

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



127
128
129
130
131
132
133
# File 'lib/lazylead/system/jira.rb', line 127

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

#emailObject



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

def email
  @usr["emailAddress"]
end

#hashObject



137
138
139
# File 'lib/lazylead/system/jira.rb', line 137

def hash
  id.hash
end

#idObject



115
116
117
# File 'lib/lazylead/system/jira.rb', line 115

def id
  @usr["name"]
end

#inspectObject



145
146
147
# File 'lib/lazylead/system/jira.rb', line 145

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

#nameObject



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

def name
  @usr["displayName"]
end

#to_sObject



141
142
143
# File 'lib/lazylead/system/jira.rb', line 141

def to_s
  inspect
end