Class: JSS::IBeacon
- Defined in:
- lib/jss/api_object/ibeacon.rb,
lib/jss.rb
Overview
An iBeacon in the JSS.
Constant Summary collapse
- RSRC_BASE =
The base for REST resources of this class
'ibeacons'.freeze
- RSRC_LIST_KEY =
the hash key used for the JSON list output of all objects in the JSS
:ibeacons
- RSRC_OBJECT_KEY =
The hash key used for the JSON object output. It's also used in various error messages
:ibeacon
- OBJECT_HISTORY_OBJECT_TYPE =
the object type for this object in the object history table. See APIObject#add_object_history_entry
360
- MAJOR_MINOR_RANGE =
The major & minor values, if used, must be in this range
0..65_535.freeze
- MAJOR_MINOR_UNUSED =
If not used, this is the value for the major and minor
-1
Instance Attribute Summary collapse
-
#major ⇒ IPAddr
an integer within MAJOR_MINOR_RANGE or MAJOR_MINOR_UNUSED.
-
#minor ⇒ IPAddr
an integer within MAJOR_MINOR_RANGE or MAJOR_MINOR_UNUSED.
-
#need_to_update ⇒ Boolean
included
from Updatable
readonly
Do we have unsaved changes?.
-
#uuid ⇒ String
The top-level region identifier, a valid UUID.
Instance Method Summary collapse
-
#clone(new_name, api: nil) ⇒ APIObject
included
from Creatable
make a clone of this API object, with a new name.
- #create ⇒ Object
-
#initialize(args = {}) ⇒ IBeacon
constructor
Constructor.
-
#name=(newname) ⇒ void
included
from Updatable
Change the name of this item Remember to #update to push changes to the server.
- #update ⇒ Object
-
#using_major? ⇒ Boolean
Is the major identifier being used in this region?.
-
#using_minor? ⇒ Boolean
Is the minor identifier being used in this region?.
Constructor Details
#initialize(args = {}) ⇒ IBeacon
Constructor
92 93 94 95 96 97 98 99 100 101 102 |
# File 'lib/jss/api_object/ibeacon.rb', line 92 def initialize(args = {}) super args @uuid = @init_data[:uuid] @major = @init_data[:major] @minor = @init_data[:minor] # defaults @major ||= MAJOR_MINOR_UNUSED @minor ||= MAJOR_MINOR_UNUSED end |
Instance Attribute Details
#major ⇒ IPAddr
an integer within MAJOR_MINOR_RANGE or MAJOR_MINOR_UNUSED
83 84 85 |
# File 'lib/jss/api_object/ibeacon.rb', line 83 def major @major end |
#minor ⇒ IPAddr
an integer within MAJOR_MINOR_RANGE or MAJOR_MINOR_UNUSED
87 88 89 |
# File 'lib/jss/api_object/ibeacon.rb', line 87 def minor @minor end |
#need_to_update ⇒ Boolean (readonly) Originally defined in module Updatable
Returns do we have unsaved changes?.
#uuid ⇒ String
Returns the top-level region identifier, a valid UUID.
79 80 81 |
# File 'lib/jss/api_object/ibeacon.rb', line 79 def uuid @uuid end |
Instance Method Details
#clone(new_name, api: nil) ⇒ APIObject Originally defined in module Creatable
make a clone of this API object, with a new name. The class must be creatable
#create ⇒ Object
166 167 168 169 170 |
# File 'lib/jss/api_object/ibeacon.rb', line 166 def create raise JSS::MissingDataError, 'uuid may not be empty' if @uuid.to_s.empty? super end |
#name=(newname) ⇒ void Originally defined in module Updatable
This method returns an undefined value.
Change the name of this item Remember to #update to push changes to the server.
#update ⇒ Object
173 174 175 176 177 |
# File 'lib/jss/api_object/ibeacon.rb', line 173 def update raise JSS::MissingDataError, 'uuid may not be empty' if @uuid.to_s.empty? super end |
#using_major? ⇒ Boolean
Returns is the major identifier being used in this region?.
156 157 158 |
# File 'lib/jss/api_object/ibeacon.rb', line 156 def using_major? @major == MAJOR_MINOR_UNUSED end |
#using_minor? ⇒ Boolean
Returns is the minor identifier being used in this region?.
161 162 163 |
# File 'lib/jss/api_object/ibeacon.rb', line 161 def using_minor? @minor == MAJOR_MINOR_UNUSED end |