Method: PureCloud::SearchCriteria#initialize
- Defined in:
- lib/purecloud/models/search_criteria.rb
#initialize(attributes = {}) ⇒ SearchCriteria
Returns a new instance of SearchCriteria.
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
# File 'lib/purecloud/models/search_criteria.rb', line 75 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo} if attributes[:'endValue'] self.end_value = attributes[:'endValue'] end if attributes[:'values'] if (value = attributes[:'values']).is_a?(Array) self.values = value end end if attributes[:'startValue'] self.start_value = attributes[:'startValue'] end if attributes[:'type'] self.type = attributes[:'type'] end if attributes[:'fields'] if (value = attributes[:'fields']).is_a?(Array) self.fields = value end end if attributes[:'value'] self.value = attributes[:'value'] end if attributes[:'operator'] self.operator = attributes[:'operator'] end if attributes[:'group'] if (value = attributes[:'group']).is_a?(Array) self.group = value end end end |