Class: Verizon::DtoFilter
- Defined in:
- lib/verizon/models/dto_filter.rb
Overview
DtoFilter Model.
Instance Attribute Summary collapse
-
#m_expand ⇒ String
Use to provide device details for alerts specific to a device.
-
#m_limitnumber ⇒ Integer
Limit the number of results returned.
-
#m_nopagination ⇒ TrueClass | FalseClass
A flag set to show if pagination requested (false) or not (true).
-
#m_page ⇒ String
A flag set to show if pagination requested (false) or not (true).
-
#m_pagenumber ⇒ Integer
A flag set to show if pagination requested (false) or not (true).
-
#m_projection ⇒ Array[String]
Limits the fields of the device that the user is interested in rather than all of the fields.
-
#m_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(m_expand: SKIP, m_limitnumber: SKIP, m_nopagination: SKIP, m_page: SKIP, m_pagenumber: SKIP, m_projection: SKIP, m_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(m_expand: SKIP, m_limitnumber: SKIP, m_nopagination: SKIP, m_page: SKIP, m_pagenumber: SKIP, m_projection: SKIP, m_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(m_expand: SKIP, m_limitnumber: SKIP, m_nopagination: SKIP, m_page: SKIP, m_pagenumber: SKIP, m_projection: SKIP, m_selection: SKIP) @m_expand = unless == SKIP @m_limitnumber = m_limitnumber unless m_limitnumber == SKIP @m_nopagination = m_nopagination unless m_nopagination == SKIP @m_page = m_page unless m_page == SKIP @m_pagenumber = m_pagenumber unless m_pagenumber == SKIP @m_projection = m_projection unless m_projection == SKIP @m_selection = m_selection unless m_selection == SKIP end |
Instance Attribute Details
#m_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 @m_expand end |
#m_limitnumber ⇒ Integer
Limit the number of results returned
18 19 20 |
# File 'lib/verizon/models/dto_filter.rb', line 18 def m_limitnumber @m_limitnumber end |
#m_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 m_nopagination @m_nopagination end |
#m_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 m_page @m_page end |
#m_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 m_pagenumber @m_pagenumber end |
#m_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 m_projection @m_projection end |
#m_selection ⇒ Hash[String, Object]
Filters results based on user defined criteria
39 40 41 |
# File 'lib/verizon/models/dto_filter.rb', line 39 def m_selection @m_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 m_limitnumber = hash.key?('$limitnumber') ? hash['$limitnumber'] : SKIP m_nopagination = hash.key?('$nopagination') ? hash['$nopagination'] : SKIP m_page = hash.key?('$page') ? hash['$page'] : SKIP m_pagenumber = hash.key?('$pagenumber') ? hash['$pagenumber'] : SKIP m_projection = hash.key?('$projection') ? hash['$projection'] : SKIP m_selection = hash.key?('$selection') ? hash['$selection'] : SKIP # Create object from extracted values. DtoFilter.new(m_expand: , m_limitnumber: m_limitnumber, m_nopagination: m_nopagination, m_page: m_page, m_pagenumber: m_pagenumber, m_projection: m_projection, m_selection: m_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['m_expand'] = '$expand' @_hash['m_limitnumber'] = '$limitnumber' @_hash['m_nopagination'] = '$nopagination' @_hash['m_page'] = '$page' @_hash['m_pagenumber'] = '$pagenumber' @_hash['m_projection'] = '$projection' @_hash['m_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[ m_expand m_limitnumber m_nopagination m_page m_pagenumber m_projection m_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} m_expand: #{@m_expand.inspect}, m_limitnumber: #{@m_limitnumber.inspect},"\ " m_nopagination: #{@m_nopagination.inspect}, m_page: #{@m_page.inspect}, m_pagenumber:"\ " #{@m_pagenumber.inspect}, m_projection: #{@m_projection.inspect}, m_selection:"\ " #{@m_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} m_expand: #{@m_expand}, m_limitnumber: #{@m_limitnumber}, m_nopagination:"\ " #{@m_nopagination}, m_page: #{@m_page}, m_pagenumber: #{@m_pagenumber}, m_projection:"\ " #{@m_projection}, m_selection: #{@m_selection}>" end |