Class: CTM::Number

Inherits:
Base
  • Object
show all
Defined in:
lib/ctm/number.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#token

Instance Method Summary collapse

Methods inherited from Base

create, #release!, #save

Constructor Details

#initialize(data, token = nil) ⇒ Number

Returns a new instance of Number.



6
7
8
9
10
11
12
13
14
15
# File 'lib/ctm/number.rb', line 6

def initialize(data, token=nil)
  super(data, token)
  @id         = data['id']
  @account_id = data['account_id']
  @name       = data['name']
  @number     = data['number']
  @formatted  = data['formatted']
  @split      = data['split']
  @routing    = data['routing']
end

Instance Attribute Details

#account_idObject (readonly)

Returns the value of attribute account_id.



3
4
5
# File 'lib/ctm/number.rb', line 3

def 
  @account_id
end

#formattedObject

Returns the value of attribute formatted.



4
5
6
# File 'lib/ctm/number.rb', line 4

def formatted
  @formatted
end

#idObject (readonly)

Returns the value of attribute id.



3
4
5
# File 'lib/ctm/number.rb', line 3

def id
  @id
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/ctm/number.rb', line 4

def name
  @name
end

#numberObject

Returns the value of attribute number.



4
5
6
# File 'lib/ctm/number.rb', line 4

def number
  @number
end

#routingObject

Returns the value of attribute routing.



4
5
6
# File 'lib/ctm/number.rb', line 4

def routing
  @routing
end

#splitObject

Returns the value of attribute split.



4
5
6
# File 'lib/ctm/number.rb', line 4

def split
  @split
end

Instance Method Details

#receiving_numbers(options = {}) ⇒ Object



17
18
19
# File 'lib/ctm/number.rb', line 17

def receiving_numbers(options={})
  CTM::ReceivingNumberList.new(options.merge(:account_id => @account_id, :number_id => @id), @token)
end

#sourceObject



21
22
# File 'lib/ctm/number.rb', line 21

def source
end