Class: Lazylead::ComponentCC

Inherits:
PredefinedCC show all
Defined in:
lib/lazylead/cc.rb

Overview

CC addresses based on Jira component owners for email notification. Allows to detect the CC for particular ticket based on its component.

Author

Yurii Dubinka ([email protected])

Copyright

Copyright © 2019-2020 Yurii Dubinka

License

MIT

Instance Method Summary collapse

Methods inherited from PredefinedCC

#[], #cc

Constructor Details

#initialize(prj, jira) ⇒ ComponentCC

Returns a new instance of ComponentCC.



147
148
149
150
# File 'lib/lazylead/cc.rb', line 147

def initialize(prj, jira)
  @prj = prj
  @jira = jira
end

Instance Method Details

#to_hObject



152
153
154
155
156
157
158
159
160
# File 'lib/lazylead/cc.rb', line 152

def to_h
  @to_h ||= begin
              components.each_with_object({}) do |c, h|
                email = lead(c.attrs["id"])
                next if email.nil? || email.blank?
                h[c.attrs["name"]] = email
              end
            end
end