Method: PureCloud::Condition#initialize
- Defined in:
- lib/purecloud/models/condition.rb
#initialize(attributes = {}) ⇒ Condition
Returns a new instance of Condition.
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/purecloud/models/condition.rb', line 54 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[:'type'] self.type = attributes[:'type'] end if attributes[:'inverted'] self.inverted = attributes[:'inverted'] else self.inverted = false end if attributes[:'attributeName'] self.attribute_name = attributes[:'attributeName'] end if attributes[:'value'] self.value = attributes[:'value'] end if attributes[:'valueType'] self.value_type = attributes[:'valueType'] end if attributes[:'operator'] self.operator = attributes[:'operator'] end if attributes[:'codes'] if (value = attributes[:'codes']).is_a?(Array) self.codes = value end end end |