Class: Nexpose::TicketSummary
- Inherits:
-
Object
- Object
- Nexpose::TicketSummary
- Defined in:
- lib/nexpose/ticket.rb
Overview
Summary of ticket information returned from a ticket listing request. For more details, issue a ticket detail request.
Instance Attribute Summary collapse
-
#assigned_to ⇒ Object
The login name of person to whom the ticket is assigned.
-
#author ⇒ Object
The login name of the person who created the ticket.
-
#created_on ⇒ Object
Date and time of ticket creation.
-
#device_id ⇒ Object
The asset the ticket is created for.
-
#id ⇒ Object
The ID number of the ticket.
-
#name ⇒ Object
Ticket name.
-
#priority ⇒ Object
The relative priority of the ticket, assigned by the creator of the ticket.
-
#state ⇒ Object
The current status of the ticket.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(id, name) ⇒ TicketSummary
constructor
A new instance of TicketSummary.
Constructor Details
#initialize(id, name) ⇒ TicketSummary
Returns a new instance of TicketSummary.
185 186 187 |
# File 'lib/nexpose/ticket.rb', line 185 def initialize(id, name) @id, @name = id, name end |
Instance Attribute Details
#assigned_to ⇒ Object
The login name of person to whom the ticket is assigned. The user must have view asset privilege on the asset specified in the device-id attribute.
170 171 172 |
# File 'lib/nexpose/ticket.rb', line 170 def assigned_to @assigned_to end |
#author ⇒ Object
The login name of the person who created the ticket.
177 178 179 |
# File 'lib/nexpose/ticket.rb', line 177 def @author end |
#created_on ⇒ Object
Date and time of ticket creation.
180 181 182 |
# File 'lib/nexpose/ticket.rb', line 180 def created_on @created_on end |
#device_id ⇒ Object
The asset the ticket is created for.
166 167 168 |
# File 'lib/nexpose/ticket.rb', line 166 def device_id @device_id end |
#id ⇒ Object
The ID number of the ticket.
160 161 162 |
# File 'lib/nexpose/ticket.rb', line 160 def id @id end |
#name ⇒ Object
Ticket name.
163 164 165 |
# File 'lib/nexpose/ticket.rb', line 163 def name @name end |
#priority ⇒ Object
The relative priority of the ticket, assigned by the creator of the ticket.
174 175 176 |
# File 'lib/nexpose/ticket.rb', line 174 def priority @priority end |
#state ⇒ Object
The current status of the ticket.
183 184 185 |
# File 'lib/nexpose/ticket.rb', line 183 def state @state end |
Class Method Details
.parse(xml) ⇒ Object
189 190 191 192 193 194 195 196 197 198 199 200 |
# File 'lib/nexpose/ticket.rb', line 189 def self.parse(xml) ticket = new(xml.attributes['id'].to_i, xml.attributes['name']) ticket.device_id = xml.attributes['device-id'].to_i ticket.assigned_to = xml.attributes['assigned-to'] ticket.priority = xml.attributes['priority'] ticket. = xml.attributes['author'] ticket.created_on = DateTime::parse(xml.attributes['created-on']) lookup = Ticket::State.constants.reduce({}) { |a, e| a[Ticket::State.const_get(e)] = e; a } ticket.state = lookup[xml.attributes['state']] ticket end |