Class: ForemanPatch::Ticket::AffectedItems
- Inherits:
-
Object
- Object
- ForemanPatch::Ticket::AffectedItems
- Includes:
- API
- Defined in:
- app/services/foreman_patch/ticket/affected_items.rb
Instance Attribute Summary collapse
-
#ticket ⇒ Object
readonly
Returns the value of attribute ticket.
Attributes included from API
Instance Method Summary collapse
- #add(hosts) ⇒ Object
-
#initialize(ticket) ⇒ AffectedItems
constructor
A new instance of AffectedItems.
- #items ⇒ Object
- #remove(hosts) ⇒ Object
- #set(hosts) ⇒ Object
Constructor Details
#initialize(ticket) ⇒ AffectedItems
Returns a new instance of AffectedItems.
8 9 10 |
# File 'app/services/foreman_patch/ticket/affected_items.rb', line 8 def initialize(ticket) @ticket = ticket end |
Instance Attribute Details
#ticket ⇒ Object (readonly)
Returns the value of attribute ticket.
6 7 8 |
# File 'app/services/foreman_patch/ticket/affected_items.rb', line 6 def ticket @ticket end |
Instance Method Details
#add(hosts) ⇒ Object
26 27 28 29 30 |
# File 'app/services/foreman_patch/ticket/affected_items.rb', line 26 def add(hosts) add_affected_items(select_cmdb_items(get_configuration_items(hosts), true)) @items = get_affected_items end |
#items ⇒ Object
12 13 14 |
# File 'app/services/foreman_patch/ticket/affected_items.rb', line 12 def items @items ||= get_affected_items end |
#remove(hosts) ⇒ Object
32 33 34 35 36 |
# File 'app/services/foreman_patch/ticket/affected_items.rb', line 32 def remove(hosts) remove_affected_items(select_affected_items(get_configuration_items(hosts))) @items = get_affected_items end |
#set(hosts) ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'app/services/foreman_patch/ticket/affected_items.rb', line 16 def set(hosts) cmdb_items = get_configuration_items(hosts) add_affected_items(select_cmdb_items(cmdb_items, true)) remove_affected_items(select_affected_items(cmdb_items, true)) @items = get_affected_items end |