Class: BoundioV2::Call

Inherits:
Resource show all
Defined in:
lib/boundioV2/call.rb

Defined Under Namespace

Classes: NoVoiceFile, NotEnoughPoints

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Resource

api_version, create, #initialize, request

Constructor Details

This class inherits a constructor from BoundioV2::Resource

Instance Attribute Details

#castObject

Returns the value of attribute cast.



3
4
5
# File 'lib/boundioV2/call.rb', line 3

def cast
  @cast
end

#idObject

Returns the value of attribute id.



3
4
5
# File 'lib/boundioV2/call.rb', line 3

def id
  @id
end

#tel_toObject

Returns the value of attribute tel_to.



3
4
5
# File 'lib/boundioV2/call.rb', line 3

def tel_to
  @tel_to
end

Class Method Details

.exceptionsObject



4
5
6
# File 'lib/boundioV2/call.rb', line 4

def self.exceptions
  super.merge(3 => NoVoiceFile, 4 => NotEnoughPoints)
end

Instance Method Details

#saveObject



8
9
10
11
12
# File 'lib/boundioV2/call.rb', line 8

def save
  res = self.class.request :post, "/call", :tel_to => tel_to, :cast => cast
  self.id = res["_id"]
  true
end

#statusObject



14
15
16
# File 'lib/boundioV2/call.rb', line 14

def status
  TelStatus.find(id)
end