Class: VoiceVault::Claimant
- Inherits:
-
Object
- Object
- VoiceVault::Claimant
- Defined in:
- lib/voice_vault/claimant.rb
Instance Attribute Summary collapse
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Class Method Summary collapse
-
.create(connection, app_id) ⇒ Object
Register a new “claimant” to be enrolled within VoiceVault Fusion The organisation unit ID (GUID) representing the customer for this instance In email from VoiceVault it’s named “VIGO_APP_ID”.
Instance Method Summary collapse
-
#destroy ⇒ Object
Remove all data from VoiceVault servers.
-
#initialize(id, connection) ⇒ Claimant
constructor
A new instance of Claimant.
Constructor Details
#initialize(id, connection) ⇒ Claimant
Returns a new instance of Claimant.
20 21 22 23 |
# File 'lib/voice_vault/claimant.rb', line 20 def initialize(id, connection) @id = id @connection = connection end |
Instance Attribute Details
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
18 19 20 |
# File 'lib/voice_vault/claimant.rb', line 18 def connection @connection end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
18 19 20 |
# File 'lib/voice_vault/claimant.rb', line 18 def id @id end |
Class Method Details
.create(connection, app_id) ⇒ Object
Register a new “claimant” to be enrolled within VoiceVault Fusion The organisation unit ID (GUID) representing the customer for this instance In email from VoiceVault it’s named “VIGO_APP_ID”
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/voice_vault/claimant.rb', line 7 def self.create(connection, app_id) params = { organisation_unit: app_id } result = connection.post "RegisterClaimant.ashx", params raise VoiceVault::Error.new("Failed to register claimant: #{result["message"]}") if result["status_code"] != "0" new(result["claimant_id"], connection) end |
Instance Method Details
#destroy ⇒ Object
Remove all data from VoiceVault servers
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/voice_vault/claimant.rb', line 26 def destroy params = { claimant_id: @id } result = @connection.post "DeleteClaiamant.ashx", params raise VoiceVault::Error.new("Failed to register claimant: #{result["message"]}") if result["status_code"] != "0" result["request_status"] end |