Class: MistApi::UiSettingsTileTimeRange

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

Overview

UiSettingsTileTimeRange 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(mend = SKIP, end_date = SKIP, interval = SKIP, name = SKIP, short_name = SKIP, start = SKIP, use_preset = SKIP) ⇒ UiSettingsTileTimeRange

Returns a new instance of UiSettingsTileTimeRange.



71
72
73
74
75
76
77
78
79
80
# File 'lib/mist_api/models/ui_settings_tile_time_range.rb', line 71

def initialize(mend = SKIP, end_date = SKIP, interval = SKIP, name = SKIP,
               short_name = SKIP, start = SKIP, use_preset = SKIP)
  @mend = mend unless mend == SKIP
  @end_date = end_date unless end_date == SKIP
  @interval = interval unless interval == SKIP
  @name = name unless name == SKIP
  @short_name = short_name unless short_name == SKIP
  @start = start unless start == SKIP
  @use_preset = use_preset unless use_preset == SKIP
end

Instance Attribute Details

#end_dateString

TODO: Write general description for this method

Returns:

  • (String)


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

def end_date
  @end_date
end

#intervalString

TODO: Write general description for this method

Returns:

  • (String)


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

def interval
  @interval
end

#mendFloat

TODO: Write general description for this method

Returns:

  • (Float)


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

def mend
  @mend
end

#nameString

TODO: Write general description for this method

Returns:

  • (String)


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

def name
  @name
end

#short_nameString

TODO: Write general description for this method

Returns:

  • (String)


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

def short_name
  @short_name
end

#startInteger

TODO: Write general description for this method

Returns:

  • (Integer)


34
35
36
# File 'lib/mist_api/models/ui_settings_tile_time_range.rb', line 34

def start
  @start
end

#use_presetTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


38
39
40
# File 'lib/mist_api/models/ui_settings_tile_time_range.rb', line 38

def use_preset
  @use_preset
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/mist_api/models/ui_settings_tile_time_range.rb', line 83

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  mend = hash.key?('end') ? hash['end'] : SKIP
  end_date = hash.key?('endDate') ? hash['endDate'] : SKIP
  interval = hash.key?('interval') ? hash['interval'] : SKIP
  name = hash.key?('name') ? hash['name'] : SKIP
  short_name = hash.key?('shortName') ? hash['shortName'] : SKIP
  start = hash.key?('start') ? hash['start'] : SKIP
  use_preset = hash.key?('usePreset') ? hash['usePreset'] : SKIP

  # Create object from extracted values.
  UiSettingsTileTimeRange.new(mend,
                              end_date,
                              interval,
                              name,
                              short_name,
                              start,
                              use_preset)
end

.namesObject

A mapping from model property names to API property names.



41
42
43
44
45
46
47
48
49
50
51
# File 'lib/mist_api/models/ui_settings_tile_time_range.rb', line 41

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['mend'] = 'end'
  @_hash['end_date'] = 'endDate'
  @_hash['interval'] = 'interval'
  @_hash['name'] = 'name'
  @_hash['short_name'] = 'shortName'
  @_hash['start'] = 'start'
  @_hash['use_preset'] = 'usePreset'
  @_hash
end

.nullablesObject

An array for nullable fields



67
68
69
# File 'lib/mist_api/models/ui_settings_tile_time_range.rb', line 67

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    mend
    end_date
    interval
    name
    short_name
    start
    use_preset
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



113
114
115
116
117
118
# File 'lib/mist_api/models/ui_settings_tile_time_range.rb', line 113

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} mend: #{@mend.inspect}, end_date: #{@end_date.inspect}, interval:"\
  " #{@interval.inspect}, name: #{@name.inspect}, short_name: #{@short_name.inspect}, start:"\
  " #{@start.inspect}, use_preset: #{@use_preset.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



106
107
108
109
110
# File 'lib/mist_api/models/ui_settings_tile_time_range.rb', line 106

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} mend: #{@mend}, end_date: #{@end_date}, interval: #{@interval}, name:"\
  " #{@name}, short_name: #{@short_name}, start: #{@start}, use_preset: #{@use_preset}>"
end