Class: VericredClient::VisionPlanBenefits

Inherits:
Object
  • Object
show all
Defined in:
lib/vericred_client/models/vision_plan_benefits.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ VisionPlanBenefits

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
# File 'lib/vericred_client/models/vision_plan_benefits.rb', line 123

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}

  if attributes.has_key?(:'individual_deductible')
    self.individual_deductible = attributes[:'individual_deductible']
  end

  if attributes.has_key?(:'family_deductible')
    self.family_deductible = attributes[:'family_deductible']
  end

  if attributes.has_key?(:'individual_annual_max')
    self.individual_annual_max = attributes[:'individual_annual_max']
  end

  if attributes.has_key?(:'family_max_annual_max')
    self.family_max_annual_max = attributes[:'family_max_annual_max']
  end

  if attributes.has_key?(:'individual_moop')
    self.individual_moop = attributes[:'individual_moop']
  end

  if attributes.has_key?(:'family_moop')
    self.family_moop = attributes[:'family_moop']
  end

  if attributes.has_key?(:'eye_exam')
    self.eye_exam = attributes[:'eye_exam']
  end

  if attributes.has_key?(:'frame')
    self.frame = attributes[:'frame']
  end

  if attributes.has_key?(:'contacts')
    self.contacts = attributes[:'contacts']
  end

  if attributes.has_key?(:'laser_vision_correction')
    self.laser_vision_correction = attributes[:'laser_vision_correction']
  end

  if attributes.has_key?(:'progressive_lenses')
    self.progressive_lenses = attributes[:'progressive_lenses']
  end

  if attributes.has_key?(:'uv_lenses')
    self.uv_lenses = attributes[:'uv_lenses']
  end

  if attributes.has_key?(:'scratch_resistant_coating')
    self.scratch_resistant_coating = attributes[:'scratch_resistant_coating']
  end

  if attributes.has_key?(:'antireflective_coating')
    self.antireflective_coating = attributes[:'antireflective_coating']
  end

  if attributes.has_key?(:'photochromatic_single_vision')
    self.photochromatic_single_vision = attributes[:'photochromatic_single_vision']
  end

  if attributes.has_key?(:'photochromatic_multifocal')
    self.photochromatic_multifocal = attributes[:'photochromatic_multifocal']
  end

  if attributes.has_key?(:'polychromatic_single_vision')
    self.polychromatic_single_vision = attributes[:'polychromatic_single_vision']
  end

  if attributes.has_key?(:'polychromatic_multifocal')
    self.polychromatic_multifocal = attributes[:'polychromatic_multifocal']
  end

end

Instance Attribute Details

#antireflective_coatingObject

Antireflective Coating benefit string



58
59
60
# File 'lib/vericred_client/models/vision_plan_benefits.rb', line 58

def antireflective_coating
  @antireflective_coating
end

#contactsObject

Contacts benefit string



43
44
45
# File 'lib/vericred_client/models/vision_plan_benefits.rb', line 43

def contacts
  @contacts
end

#eye_examObject

Eye Exam benefit string



37
38
39
# File 'lib/vericred_client/models/vision_plan_benefits.rb', line 37

def eye_exam
  @eye_exam
end

#family_deductibleObject

Family Deductible benefit string



22
23
24
# File 'lib/vericred_client/models/vision_plan_benefits.rb', line 22

def family_deductible
  @family_deductible
end

#family_max_annual_maxObject

Family Max Annual Max benefit string



28
29
30
# File 'lib/vericred_client/models/vision_plan_benefits.rb', line 28

def family_max_annual_max
  @family_max_annual_max
end

#family_moopObject

Family MOOP benefit string



34
35
36
# File 'lib/vericred_client/models/vision_plan_benefits.rb', line 34

def family_moop
  @family_moop
end

#frameObject

Frame benefit string



40
41
42
# File 'lib/vericred_client/models/vision_plan_benefits.rb', line 40

def frame
  @frame
end

#individual_annual_maxObject

Individual Annual Max benefit string



25
26
27
# File 'lib/vericred_client/models/vision_plan_benefits.rb', line 25

def individual_annual_max
  @individual_annual_max
end

#individual_deductibleObject

Individual Deductible benefit string



19
20
21
# File 'lib/vericred_client/models/vision_plan_benefits.rb', line 19

def individual_deductible
  @individual_deductible
end

#individual_moopObject

Individual MOOP benefit string



31
32
33
# File 'lib/vericred_client/models/vision_plan_benefits.rb', line 31

def individual_moop
  @individual_moop
end

#laser_vision_correctionObject

Laser Vision Correction benefit string



46
47
48
# File 'lib/vericred_client/models/vision_plan_benefits.rb', line 46

def laser_vision_correction
  @laser_vision_correction
end

#photochromatic_multifocalObject

Photochromatic - Mutlifocal benefit string



64
65
66
# File 'lib/vericred_client/models/vision_plan_benefits.rb', line 64

def photochromatic_multifocal
  @photochromatic_multifocal
end

#photochromatic_single_visionObject

Photochromatic - Single Vision benefit string



61
62
63
# File 'lib/vericred_client/models/vision_plan_benefits.rb', line 61

def photochromatic_single_vision
  @photochromatic_single_vision
end

#polychromatic_multifocalObject

Polychromatic - Mutlifocal benefit string



70
71
72
# File 'lib/vericred_client/models/vision_plan_benefits.rb', line 70

def polychromatic_multifocal
  @polychromatic_multifocal
end

#polychromatic_single_visionObject

Polychromatic - Single Vision benefit string



67
68
69
# File 'lib/vericred_client/models/vision_plan_benefits.rb', line 67

def polychromatic_single_vision
  @polychromatic_single_vision
end

#progressive_lensesObject

Progressive Lenses benefit string



49
50
51
# File 'lib/vericred_client/models/vision_plan_benefits.rb', line 49

def progressive_lenses
  @progressive_lenses
end

#scratch_resistant_coatingObject

Scratch-Resistant Coating benefit string



55
56
57
# File 'lib/vericred_client/models/vision_plan_benefits.rb', line 55

def scratch_resistant_coating
  @scratch_resistant_coating
end

#uv_lensesObject

UV Lenses benefit string



52
53
54
# File 'lib/vericred_client/models/vision_plan_benefits.rb', line 52

def uv_lenses
  @uv_lenses
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/vericred_client/models/vision_plan_benefits.rb', line 74

def self.attribute_map
  {
    :'individual_deductible' => :'individual_deductible',
    :'family_deductible' => :'family_deductible',
    :'individual_annual_max' => :'individual_annual_max',
    :'family_max_annual_max' => :'family_max_annual_max',
    :'individual_moop' => :'individual_moop',
    :'family_moop' => :'family_moop',
    :'eye_exam' => :'eye_exam',
    :'frame' => :'frame',
    :'contacts' => :'contacts',
    :'laser_vision_correction' => :'laser_vision_correction',
    :'progressive_lenses' => :'progressive_lenses',
    :'uv_lenses' => :'uv_lenses',
    :'scratch_resistant_coating' => :'scratch_resistant_coating',
    :'antireflective_coating' => :'antireflective_coating',
    :'photochromatic_single_vision' => :'photochromatic_single_vision',
    :'photochromatic_multifocal' => :'photochromatic_multifocal',
    :'polychromatic_single_vision' => :'polychromatic_single_vision',
    :'polychromatic_multifocal' => :'polychromatic_multifocal'
  }
end

.swagger_typesObject

Attribute type mapping.



98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# File 'lib/vericred_client/models/vision_plan_benefits.rb', line 98

def self.swagger_types
  {
    :'individual_deductible' => :'String',
    :'family_deductible' => :'String',
    :'individual_annual_max' => :'String',
    :'family_max_annual_max' => :'String',
    :'individual_moop' => :'String',
    :'family_moop' => :'String',
    :'eye_exam' => :'String',
    :'frame' => :'String',
    :'contacts' => :'String',
    :'laser_vision_correction' => :'String',
    :'progressive_lenses' => :'String',
    :'uv_lenses' => :'String',
    :'scratch_resistant_coating' => :'String',
    :'antireflective_coating' => :'String',
    :'photochromatic_single_vision' => :'String',
    :'photochromatic_multifocal' => :'String',
    :'polychromatic_single_vision' => :'String',
    :'polychromatic_multifocal' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
# File 'lib/vericred_client/models/vision_plan_benefits.rb', line 218

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      individual_deductible == o.individual_deductible &&
      family_deductible == o.family_deductible &&
      individual_annual_max == o.individual_annual_max &&
      family_max_annual_max == o.family_max_annual_max &&
      individual_moop == o.individual_moop &&
      family_moop == o.family_moop &&
      eye_exam == o.eye_exam &&
      frame == o.frame &&
      contacts == o.contacts &&
      laser_vision_correction == o.laser_vision_correction &&
      progressive_lenses == o.progressive_lenses &&
      uv_lenses == o.uv_lenses &&
      scratch_resistant_coating == o.scratch_resistant_coating &&
      antireflective_coating == o.antireflective_coating &&
      photochromatic_single_vision == o.photochromatic_single_vision &&
      photochromatic_multifocal == o.photochromatic_multifocal &&
      polychromatic_single_vision == o.polychromatic_single_vision &&
      polychromatic_multifocal == o.polychromatic_multifocal
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
# File 'lib/vericred_client/models/vision_plan_benefits.rb', line 277

def _deserialize(type, value)
  case type.to_sym
  when :DateTime
    DateTime.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :BOOLEAN
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    temp_model = VericredClient.const_get(type).new
    temp_model.build_from_hash(value)
  end
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



343
344
345
346
347
348
349
350
351
352
353
354
355
# File 'lib/vericred_client/models/vision_plan_benefits.rb', line 343

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map{ |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
# File 'lib/vericred_client/models/vision_plan_benefits.rb', line 256

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.swagger_types.each_pair do |key, type|
    if type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


243
244
245
# File 'lib/vericred_client/models/vision_plan_benefits.rb', line 243

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



249
250
251
# File 'lib/vericred_client/models/vision_plan_benefits.rb', line 249

def hash
  [individual_deductible, family_deductible, individual_annual_max, family_max_annual_max, individual_moop, family_moop, eye_exam, frame, contacts, laser_vision_correction, progressive_lenses, uv_lenses, scratch_resistant_coating, antireflective_coating, photochromatic_single_vision, photochromatic_multifocal, polychromatic_single_vision, polychromatic_multifocal].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



205
206
207
208
# File 'lib/vericred_client/models/vision_plan_benefits.rb', line 205

def list_invalid_properties
  invalid_properties = Array.new
  return invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



323
324
325
# File 'lib/vericred_client/models/vision_plan_benefits.rb', line 323

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



329
330
331
332
333
334
335
336
337
# File 'lib/vericred_client/models/vision_plan_benefits.rb', line 329

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    next if value.nil?
    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



317
318
319
# File 'lib/vericred_client/models/vision_plan_benefits.rb', line 317

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



212
213
214
# File 'lib/vericred_client/models/vision_plan_benefits.rb', line 212

def valid?
  return true
end