Class: EwayRapid::InternalModels::Verification

Inherits:
Object
  • Object
show all
Defined in:
lib/eway_rapid/models/internal_models.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#addressObject

Returns the value of attribute address.



400
401
402
# File 'lib/eway_rapid/models/internal_models.rb', line 400

def address
  @address
end

#cvnObject

Returns the value of attribute cvn.



399
400
401
# File 'lib/eway_rapid/models/internal_models.rb', line 399

def cvn
  @cvn
end

#emailObject

Returns the value of attribute email.



401
402
403
# File 'lib/eway_rapid/models/internal_models.rb', line 401

def email
  @email
end

#mobileObject

Returns the value of attribute mobile.



402
403
404
# File 'lib/eway_rapid/models/internal_models.rb', line 402

def mobile
  @mobile
end

#phoneObject

Returns the value of attribute phone.



403
404
405
# File 'lib/eway_rapid/models/internal_models.rb', line 403

def phone
  @phone
end

Class Method Details

.from_hash(hash) ⇒ Object



420
421
422
423
424
425
426
427
428
# File 'lib/eway_rapid/models/internal_models.rb', line 420

def self.from_hash(hash)
  verification = Verification.new
  verification.cvn = hash[Constants::CVN]
  verification.address = hash[Constants::ADDRESS]
  verification.email = hash[Constants::EMAIL]
  verification.mobile = hash[Constants::MOBILE]
  verification.phone = hash[Constants::PHONE]
  verification
end

.from_json(json) ⇒ Object



415
416
417
418
# File 'lib/eway_rapid/models/internal_models.rb', line 415

def self.from_json(json)
  hash = JSON.parse(json)
  from_hash(hash)
end

Instance Method Details

#to_json(options = {}) ⇒ Object



405
406
407
408
409
410
411
412
413
# File 'lib/eway_rapid/models/internal_models.rb', line 405

def to_json(options={})
  hash = {}
  hash[Constants::CVN] = cvn if cvn
  hash[Constants::ADDRESS] = address if address
  hash[Constants::EMAIL] = email if email
  hash[Constants::MOBILE] = mobile if mobile
  hash[Constants::PHONE] = phone if phone
  hash.to_json
end