Class: Verizon::DtoFilter
- Defined in:
- lib/verizon/models/dto_filter.rb
Overview
DtoFilter Model.
Instance Attribute Summary collapse
-
#expand ⇒ String
Use to provide device details for alerts specific to a device.
-
#limitnumber ⇒ Integer
Limit the number of results returned.
-
#nopagination ⇒ TrueClass | FalseClass
A flag set to show if pagination requested (false) or not (true).
-
#page ⇒ String
A flag set to show if pagination requested (false) or not (true).
-
#pagenumber ⇒ Integer
A flag set to show if pagination requested (false) or not (true).
-
#projection ⇒ Array[String]
Limits the fields of the device that the user is interested in rather than all of the fields.
-
#selection ⇒ Hash[String, Object]
Filters results based on user defined criteria.
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(expand = SKIP, limitnumber = SKIP, nopagination = SKIP, page = SKIP, pagenumber = SKIP, projection = SKIP, selection = SKIP) ⇒ DtoFilter
constructor
A new instance of DtoFilter.
-
#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(expand = SKIP, limitnumber = SKIP, nopagination = SKIP, page = SKIP, pagenumber = SKIP, projection = SKIP, selection = SKIP) ⇒ DtoFilter
Returns a new instance of DtoFilter.
72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/verizon/models/dto_filter.rb', line 72 def initialize( = SKIP, limitnumber = SKIP, nopagination = SKIP, page = SKIP, pagenumber = SKIP, projection = SKIP, selection = SKIP) @expand = unless == SKIP @limitnumber = limitnumber unless limitnumber == SKIP @nopagination = nopagination unless nopagination == SKIP @page = page unless page == SKIP @pagenumber = pagenumber unless pagenumber == SKIP @projection = projection unless projection == SKIP @selection = selection unless selection == SKIP end |
Instance Attribute Details
#expand ⇒ String
Use to provide device details for alerts specific to a device
14 15 16 |
# File 'lib/verizon/models/dto_filter.rb', line 14 def @expand end |
#limitnumber ⇒ Integer
Limit the number of results returned
18 19 20 |
# File 'lib/verizon/models/dto_filter.rb', line 18 def limitnumber @limitnumber end |
#nopagination ⇒ TrueClass | FalseClass
A flag set to show if pagination requested (false) or not (true)
22 23 24 |
# File 'lib/verizon/models/dto_filter.rb', line 22 def nopagination @nopagination end |
#page ⇒ String
A flag set to show if pagination requested (false) or not (true)
26 27 28 |
# File 'lib/verizon/models/dto_filter.rb', line 26 def page @page end |
#pagenumber ⇒ Integer
A flag set to show if pagination requested (false) or not (true)
30 31 32 |
# File 'lib/verizon/models/dto_filter.rb', line 30 def pagenumber @pagenumber end |
#projection ⇒ Array[String]
Limits the fields of the device that the user is interested in rather than all of the fields
35 36 37 |
# File 'lib/verizon/models/dto_filter.rb', line 35 def projection @projection end |
#selection ⇒ Hash[String, Object]
Filters results based on user defined criteria
39 40 41 |
# File 'lib/verizon/models/dto_filter.rb', line 39 def selection @selection end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
# File 'lib/verizon/models/dto_filter.rb', line 85 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. = hash.key?('$expand') ? hash['$expand'] : SKIP limitnumber = hash.key?('$limitnumber') ? hash['$limitnumber'] : SKIP nopagination = hash.key?('$nopagination') ? hash['$nopagination'] : SKIP page = hash.key?('$page') ? hash['$page'] : SKIP pagenumber = hash.key?('$pagenumber') ? hash['$pagenumber'] : SKIP projection = hash.key?('$projection') ? hash['$projection'] : SKIP selection = hash.key?('$selection') ? hash['$selection'] : SKIP # Create object from extracted values. DtoFilter.new(, limitnumber, nopagination, page, pagenumber, projection, selection) end |
.names ⇒ Object
A mapping from model property names to API property names.
42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/verizon/models/dto_filter.rb', line 42 def self.names @_hash = {} if @_hash.nil? @_hash['expand'] = '$expand' @_hash['limitnumber'] = '$limitnumber' @_hash['nopagination'] = '$nopagination' @_hash['page'] = '$page' @_hash['pagenumber'] = '$pagenumber' @_hash['projection'] = '$projection' @_hash['selection'] = '$selection' @_hash end |
.nullables ⇒ Object
An array for nullable fields
68 69 70 |
# File 'lib/verizon/models/dto_filter.rb', line 68 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/verizon/models/dto_filter.rb', line 55 def self.optionals %w[ expand limitnumber nopagination page pagenumber projection selection ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
116 117 118 119 120 121 122 |
# File 'lib/verizon/models/dto_filter.rb', line 116 def inspect class_name = self.class.name.split('::').last "<#{class_name} expand: #{@expand.inspect}, limitnumber: #{@limitnumber.inspect},"\ " nopagination: #{@nopagination.inspect}, page: #{@page.inspect}, pagenumber:"\ " #{@pagenumber.inspect}, projection: #{@projection.inspect}, selection:"\ " #{@selection.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
108 109 110 111 112 113 |
# File 'lib/verizon/models/dto_filter.rb', line 108 def to_s class_name = self.class.name.split('::').last "<#{class_name} expand: #{@expand}, limitnumber: #{@limitnumber}, nopagination:"\ " #{@nopagination}, page: #{@page}, pagenumber: #{@pagenumber}, projection: #{@projection},"\ " selection: #{@selection}>" end |