Class: JSS::Category

Inherits:
APIObject show all
Includes:
Creatable, Updatable
Defined in:
lib/jss-api/api_object/category.rb,
lib/jss-api.rb

Overview

A Category in the JSS.

See Also:

Constant Summary collapse

RSRC_BASE =

The base for REST resources of this class

"categories"
RSRC_LIST_KEY =

the hash key used for the JSON list output of all objects in the JSS

:categories
RSRC_OBJECT_KEY =

The hash key used for the JSON object output. It’s also used in various error messages

:category
VALID_DATA_KEYS =

these keys, as well as :id and :name, are present in valid API JSON data for this class

[:priority]
DEFAULT_CATEGORY =

The Default category

"Unknown"
POSSIBLE_PRIORITIES =

The range of possible priorities

1..20
DEFAULT_PRIORITY =

The Default Priority

5

Constants included from Updatable

Updatable::UPDATABLE

Constants included from Creatable

JSS::Creatable::CREATABLE

Constants inherited from APIObject

APIObject::DEFAULT_LOOKUP_KEYS, APIObject::REQUIRED_DATA_KEYS

Instance Attribute Summary collapse

Attributes included from Updatable

#need_to_update

Attributes inherited from APIObject

#id, #in_jss, #name, #rest_rsrc

Instance Method Summary collapse

Methods included from Updatable

#name=, #update

Methods included from Creatable

#create

Methods inherited from APIObject

all, all_ids, all_names, #delete, get_name, map_all_ids_to, #save, xml_list

Constructor Details

#initialize(args = {}) ⇒ Category

See JSS::APIObject#initialize



99
100
101
102
103
# File 'lib/jss-api/api_object/category.rb', line 99

def initialize(args = {})
  super
  @priority = @init_data[:priority] || DEFAULT_PRIORITY
  
end

Instance Attribute Details

#priorityInteger

Returns the SelfService priority for this category.

Returns:

  • (Integer)

    the SelfService priority for this category



90
91
92
# File 'lib/jss-api/api_object/category.rb', line 90

def priority
  @priority
end