Class: MistApi::StatsApUsbStat

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

Overview

StatsApUsbStat Model.

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(channel = SKIP, connected = SKIP, last_activity = SKIP, type = SKIP, up = SKIP) ⇒ StatsApUsbStat

Returns a new instance of StatsApUsbStat.



65
66
67
68
69
70
71
72
# File 'lib/mist_api/models/stats_ap_usb_stat.rb', line 65

def initialize(channel = SKIP, connected = SKIP, last_activity = SKIP,
               type = SKIP, up = SKIP)
  @channel = channel unless channel == SKIP
  @connected = connected unless connected == SKIP
  @last_activity = last_activity unless last_activity == SKIP
  @type = type unless type == SKIP
  @up = up unless up == SKIP
end

Instance Attribute Details

#channelInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def channel
  @channel
end

#connectedTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


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

def connected
  @connected
end

#last_activityInteger

TODO: Write general description for this method

Returns:

  • (Integer)


22
23
24
# File 'lib/mist_api/models/stats_ap_usb_stat.rb', line 22

def last_activity
  @last_activity
end

#typeString

TODO: Write general description for this method

Returns:

  • (String)


26
27
28
# File 'lib/mist_api/models/stats_ap_usb_stat.rb', line 26

def type
  @type
end

#upTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


30
31
32
# File 'lib/mist_api/models/stats_ap_usb_stat.rb', line 30

def up
  @up
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/mist_api/models/stats_ap_usb_stat.rb', line 75

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  channel = hash.key?('channel') ? hash['channel'] : SKIP
  connected = hash.key?('connected') ? hash['connected'] : SKIP
  last_activity = hash.key?('last_activity') ? hash['last_activity'] : SKIP
  type = hash.key?('type') ? hash['type'] : SKIP
  up = hash.key?('up') ? hash['up'] : SKIP

  # Create object from extracted values.
  StatsApUsbStat.new(channel,
                     connected,
                     last_activity,
                     type,
                     up)
end

.namesObject

A mapping from model property names to API property names.



33
34
35
36
37
38
39
40
41
# File 'lib/mist_api/models/stats_ap_usb_stat.rb', line 33

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['channel'] = 'channel'
  @_hash['connected'] = 'connected'
  @_hash['last_activity'] = 'last_activity'
  @_hash['type'] = 'type'
  @_hash['up'] = 'up'
  @_hash
end

.nullablesObject

An array for nullable fields



55
56
57
58
59
60
61
62
63
# File 'lib/mist_api/models/stats_ap_usb_stat.rb', line 55

def self.nullables
  %w[
    channel
    connected
    last_activity
    type
    up
  ]
end

.optionalsObject

An array for optional fields



44
45
46
47
48
49
50
51
52
# File 'lib/mist_api/models/stats_ap_usb_stat.rb', line 44

def self.optionals
  %w[
    channel
    connected
    last_activity
    type
    up
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



101
102
103
104
105
# File 'lib/mist_api/models/stats_ap_usb_stat.rb', line 101

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} channel: #{@channel.inspect}, connected: #{@connected.inspect},"\
  " last_activity: #{@last_activity.inspect}, type: #{@type.inspect}, up: #{@up.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



94
95
96
97
98
# File 'lib/mist_api/models/stats_ap_usb_stat.rb', line 94

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} channel: #{@channel}, connected: #{@connected}, last_activity:"\
  " #{@last_activity}, type: #{@type}, up: #{@up}>"
end