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.



100
101
102
# File 'lib/lazylead/system/jira.rb', line 100

def initialize(usr)
  @usr = usr
end

Instance Method Details

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



116
117
118
119
120
121
122
# File 'lib/lazylead/system/jira.rb', line 116

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

#emailObject



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

def email
  @usr["emailAddress"]
end

#hashObject



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

def hash
  id.hash
end

#idObject



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

def id
  @usr["name"]
end

#inspectObject



134
135
136
# File 'lib/lazylead/system/jira.rb', line 134

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

#nameObject



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

def name
  @usr["displayName"]
end

#to_sObject



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

def to_s
  inspect
end