Class: MistApi::ApAeroscout

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/mist_api/models/ap_aeroscout.rb

Overview

Aeroscout AP settings

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(enabled = false, host = SKIP, locate_connected = false, port = 1144) ⇒ ApAeroscout

Returns a new instance of ApAeroscout.



58
59
60
61
62
63
64
# File 'lib/mist_api/models/ap_aeroscout.rb', line 58

def initialize(enabled = false, host = SKIP, locate_connected = false,
               port = 1144)
  @enabled = enabled unless enabled == SKIP
  @host = host unless host == SKIP
  @locate_connected = locate_connected unless locate_connected == SKIP
  @port = port unless port == SKIP
end

Instance Attribute Details

#enabledTrueClass | FalseClass

Whether to enable aeroscout config

Returns:

  • (TrueClass | FalseClass)


14
15
16
# File 'lib/mist_api/models/ap_aeroscout.rb', line 14

def enabled
  @enabled
end

#hostString

Required if enabled, aeroscout server host

Returns:

  • (String)


18
19
20
# File 'lib/mist_api/models/ap_aeroscout.rb', line 18

def host
  @host
end

#locate_connectedTrueClass | FalseClass

Whether to enable the feature to allow wireless clients data received and sent to AES server for location calculation

Returns:

  • (TrueClass | FalseClass)


23
24
25
# File 'lib/mist_api/models/ap_aeroscout.rb', line 23

def locate_connected
  @locate_connected
end

#portInteger

Whether to enable the feature to allow wireless clients data received and sent to AES server for location calculation

Returns:

  • (Integer)


28
29
30
# File 'lib/mist_api/models/ap_aeroscout.rb', line 28

def port
  @port
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/mist_api/models/ap_aeroscout.rb', line 67

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  enabled = hash['enabled'] ||= false
  host = hash.key?('host') ? hash['host'] : SKIP
  locate_connected = hash['locate_connected'] ||= false
  port = hash['port'] ||= 1144

  # Create object from extracted values.
  ApAeroscout.new(enabled,
                  host,
                  locate_connected,
                  port)
end

.namesObject

A mapping from model property names to API property names.



31
32
33
34
35
36
37
38
# File 'lib/mist_api/models/ap_aeroscout.rb', line 31

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['enabled'] = 'enabled'
  @_hash['host'] = 'host'
  @_hash['locate_connected'] = 'locate_connected'
  @_hash['port'] = 'port'
  @_hash
end

.nullablesObject

An array for nullable fields



51
52
53
54
55
56
# File 'lib/mist_api/models/ap_aeroscout.rb', line 51

def self.nullables
  %w[
    host
    port
  ]
end

.optionalsObject

An array for optional fields



41
42
43
44
45
46
47
48
# File 'lib/mist_api/models/ap_aeroscout.rb', line 41

def self.optionals
  %w[
    enabled
    host
    locate_connected
    port
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



91
92
93
94
95
# File 'lib/mist_api/models/ap_aeroscout.rb', line 91

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} enabled: #{@enabled.inspect}, host: #{@host.inspect}, locate_connected:"\
  " #{@locate_connected.inspect}, port: #{@port.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



84
85
86
87
88
# File 'lib/mist_api/models/ap_aeroscout.rb', line 84

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} enabled: #{@enabled}, host: #{@host}, locate_connected:"\
  " #{@locate_connected}, port: #{@port}>"
end