Class: EwayRapid::InternalModels::BeagleVerification

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

#emailObject

Returns the value of attribute email.



4
5
6
# File 'lib/eway_rapid/models/internal_models.rb', line 4

def email
  @email
end

#phoneObject

Returns the value of attribute phone.



5
6
7
# File 'lib/eway_rapid/models/internal_models.rb', line 5

def phone
  @phone
end

Class Method Details

.from_hash(hash) ⇒ Object



19
20
21
22
23
24
# File 'lib/eway_rapid/models/internal_models.rb', line 19

def self.from_hash(hash)
  beagle_verification = self.new
  beagle_verification.email = hash[Constants::EMAIL]
  beagle_verification.phone = hash[Constants::PHONE]
  beagle_verification
end

.from_json(json) ⇒ Object



14
15
16
17
# File 'lib/eway_rapid/models/internal_models.rb', line 14

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

Instance Method Details

#to_json(options = {}) ⇒ Object



7
8
9
10
11
12
# File 'lib/eway_rapid/models/internal_models.rb', line 7

def to_json(options={})
  hash = {}
  hash[Constants::EMAIL] = email
  hash[Constants::PHONE] = phone
  hash.to_json
end