Skip to content
Snippets Groups Projects
Verified Commit 08d836a4 authored by Alexander Olofsson's avatar Alexander Olofsson
Browse files

Add some preliminary documentation strings

parent 827e1bde
No related branches found
No related tags found
No related merge requests found
Pipeline #99250 passed
...@@ -2,6 +2,17 @@ ...@@ -2,6 +2,17 @@
module LiudeskCMDB::Models module LiudeskCMDB::Models
# Linux Client v1 # Linux Client v1
#
# @!attribute [r] created_date
# @return [Time] the date of creation
# @!attribute [r] updated_date
# @return [Time] the date of change
# @!attribute hardware_id
# @return [String] the ID for the underlying HardwareV1 object
# @!attribute hostname
# @return [String] the hostname of the client
# @!attribute division
# @return [String?] the division the client belongs to
class LinuxClientV1 < LiudeskCMDB::Model class LinuxClientV1 < LiudeskCMDB::Model
api_name "Clients" api_name "Clients"
model_name "linux" model_name "linux"
...@@ -28,15 +39,21 @@ module LiudeskCMDB::Models ...@@ -28,15 +39,21 @@ module LiudeskCMDB::Models
hostname hostname
end end
# Get an instance of the underlying hardware object
#
# @return [HardwareV1] the hardware underlying this client
def hardware def hardware
@hardware ||= LiudeskCMDB::Models::HardwareV1.get(client, hardware_id) @hardware ||= LiudeskCMDB::Models::HardwareV1.get(client, hardware_id)
end end
# Change the underlying hardware object
#
# @param hardware [HardwareV1] the new hardware object to assign
def hardware=(hardware) def hardware=(hardware)
raise ArgumentError, "Must be a HardwareV1" unless hardware.is_a? LinudeskCMDB::Models::HardwareV1 raise ArgumentError, "Must be a HardwareV1" unless hardware.is_a? LinudeskCMDB::Models::HardwareV1
@hardware = hardware
self.hardware_id = hardware.guid if hardware self.hardware_id = hardware.guid if hardware
@hardware = hardware
end end
end end
end end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment