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.



420
421
422
# File 'lib/eway_rapid/models/internal_models.rb', line 420

def address
  @address
end

#cvnObject

Returns the value of attribute cvn.



419
420
421
# File 'lib/eway_rapid/models/internal_models.rb', line 419

def cvn
  @cvn
end

#emailObject

Returns the value of attribute email.



421
422
423
# File 'lib/eway_rapid/models/internal_models.rb', line 421

def email
  @email
end

#mobileObject

Returns the value of attribute mobile.



422
423
424
# File 'lib/eway_rapid/models/internal_models.rb', line 422

def mobile
  @mobile
end

#phoneObject

Returns the value of attribute phone.



423
424
425
# File 'lib/eway_rapid/models/internal_models.rb', line 423

def phone
  @phone
end

Class Method Details

.from_hash(hash) ⇒ Object



440
441
442
443
444
445
446
447
448
# File 'lib/eway_rapid/models/internal_models.rb', line 440

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



435
436
437
438
# File 'lib/eway_rapid/models/internal_models.rb', line 435

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

Instance Method Details

#to_json(options = {}) ⇒ Object



425
426
427
428
429
430
431
432
433
# File 'lib/eway_rapid/models/internal_models.rb', line 425

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