Class: Dev::Jira::User
- Defined in:
- lib/firespring_dev_commands/jira/user.rb,
lib/firespring_dev_commands/jira/user/type.rb
Overview
Contains Jira user information Jira does not make user information available through their normal api (they have an admin api that you can use) Therefore, we’ve provided a “lookup” method which attempts to find the jira user id in a hash of user information that you can configure
Defined Under Namespace
Classes: Type
Instance Attribute Summary collapse
-
#email ⇒ Object
Returns the value of attribute email.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#type ⇒ Object
Returns the value of attribute type.
Class Method Summary collapse
-
.lookup(id) ⇒ Object
Returns the Jira user object which maps to the give user id If none is found, it returns a Jira user object with only the id set.
Instance Method Summary collapse
-
#developer? ⇒ Boolean
Returns true if the Jira user is categorized as a developer.
-
#initialize(name:, email:, id:, type: Type::OTHER) ⇒ User
constructor
A new instance of User.
Constructor Details
Instance Attribute Details
#email ⇒ Object
Returns the value of attribute email.
8 9 10 |
# File 'lib/firespring_dev_commands/jira/user.rb', line 8 def email @email end |
#id ⇒ Object
Returns the value of attribute id.
8 9 10 |
# File 'lib/firespring_dev_commands/jira/user.rb', line 8 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
8 9 10 |
# File 'lib/firespring_dev_commands/jira/user.rb', line 8 def name @name end |
#type ⇒ Object
Returns the value of attribute type.
8 9 10 |
# File 'lib/firespring_dev_commands/jira/user.rb', line 8 def type @type end |
Class Method Details
.lookup(id) ⇒ Object
Returns the Jira user object which maps to the give user id If none is found, it returns a Jira user object with only the id set
24 25 26 27 28 29 30 |
# File 'lib/firespring_dev_commands/jira/user.rb', line 24 def self.lookup(id) id = id.to_s.strip id = 'notfound' if id.empty? user = Dev::Jira.config.user_lookup_list&.find { |it| it.id == id } user ||= new(name: 'Not Found', email: '[email protected]', id:) user end |