Class: MistApi::ConstEvent
- Defined in:
- lib/mist_api/models/const_event.rb
Overview
ConstEvent Model.
Instance Attribute Summary collapse
-
#description ⇒ String
TODO: Write general description for this method.
-
#display ⇒ String
TODO: Write general description for this method.
-
#example ⇒ Object
TODO: Write general description for this method.
-
#group ⇒ String
TODO: Write general description for this method.
-
#key ⇒ String
TODO: Write general description for this method.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(display = nil, key = nil, description = SKIP, example = SKIP, group = SKIP) ⇒ ConstEvent
constructor
A new instance of ConstEvent.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(display = nil, key = nil, description = SKIP, example = SKIP, group = SKIP) ⇒ ConstEvent
Returns a new instance of ConstEvent.
57 58 59 60 61 62 63 64 |
# File 'lib/mist_api/models/const_event.rb', line 57 def initialize(display = nil, key = nil, description = SKIP, example = SKIP, group = SKIP) @description = description unless description == SKIP @display = display @example = example unless example == SKIP @group = group unless group == SKIP @key = key end |
Instance Attribute Details
#description ⇒ String
TODO: Write general description for this method
14 15 16 |
# File 'lib/mist_api/models/const_event.rb', line 14 def description @description end |
#display ⇒ String
TODO: Write general description for this method
18 19 20 |
# File 'lib/mist_api/models/const_event.rb', line 18 def display @display end |
#example ⇒ Object
TODO: Write general description for this method
22 23 24 |
# File 'lib/mist_api/models/const_event.rb', line 22 def example @example end |
#group ⇒ String
TODO: Write general description for this method
26 27 28 |
# File 'lib/mist_api/models/const_event.rb', line 26 def group @group end |
#key ⇒ String
TODO: Write general description for this method
30 31 32 |
# File 'lib/mist_api/models/const_event.rb', line 30 def key @key 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 82 83 |
# File 'lib/mist_api/models/const_event.rb', line 67 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. display = hash.key?('display') ? hash['display'] : nil key = hash.key?('key') ? hash['key'] : nil description = hash.key?('description') ? hash['description'] : SKIP example = hash.key?('example') ? hash['example'] : SKIP group = hash.key?('group') ? hash['group'] : SKIP # Create object from extracted values. ConstEvent.new(display, key, description, example, group) end |
.names ⇒ Object
A mapping from model property names to API property names.
33 34 35 36 37 38 39 40 41 |
# File 'lib/mist_api/models/const_event.rb', line 33 def self.names @_hash = {} if @_hash.nil? @_hash['description'] = 'description' @_hash['display'] = 'display' @_hash['example'] = 'example' @_hash['group'] = 'group' @_hash['key'] = 'key' @_hash end |
.nullables ⇒ Object
An array for nullable fields
53 54 55 |
# File 'lib/mist_api/models/const_event.rb', line 53 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
44 45 46 47 48 49 50 |
# File 'lib/mist_api/models/const_event.rb', line 44 def self.optionals %w[ description example group ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
93 94 95 96 97 |
# File 'lib/mist_api/models/const_event.rb', line 93 def inspect class_name = self.class.name.split('::').last "<#{class_name} description: #{@description.inspect}, display: #{@display.inspect},"\ " example: #{@example.inspect}, group: #{@group.inspect}, key: #{@key.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
86 87 88 89 90 |
# File 'lib/mist_api/models/const_event.rb', line 86 def to_s class_name = self.class.name.split('::').last "<#{class_name} description: #{@description}, display: #{@display}, example: #{@example},"\ " group: #{@group}, key: #{@key}>" end |