Class: CTM::Message

Inherits:
Base
  • Object
show all
Defined in:
lib/ctm/message.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) ⇒ Message

Returns a new instance of Message.



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

def initialize(data, token=nil)
  super(data, token)
  @id            = data['id']
  @account_id    = data['account_id']
  @body          = data['body']
  @to            = data['to_number']
  @from          = data['from_number']
  @callerid      = data['callerid']
  @from_location = CTM::Base::Location.new(nil, data['from_city'], data['from_state'], data['from_country'], data['from_zip'])
  @to_location   = CTM::Base::Location.new(nil, data['to_city'], data['to_state'], data['to_country'], data['to_zip'])
  @source_id     = data['tracking_source_id']
  @direction  = data['direction']
end

Instance Attribute Details

#account_idObject (readonly)

Returns the value of attribute account_id.



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

def 
  @account_id
end

#bodyObject (readonly)

Returns the value of attribute body.



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

def body
  @body
end

#calleridObject (readonly)

Returns the value of attribute callerid.



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

def callerid
  @callerid
end

#directionObject (readonly)

Returns the value of attribute direction.



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

def direction
  @direction
end

#fromObject (readonly)

Returns the value of attribute from.



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

def from
  @from
end

#from_locationObject (readonly)

Returns the value of attribute from_location.



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

def from_location
  @from_location
end

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#source_idObject (readonly)

Returns the value of attribute source_id.



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

def source_id
  @source_id
end

#toObject (readonly)

Returns the value of attribute to.



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

def to
  @to
end

#to_locationObject (readonly)

Returns the value of attribute to_location.



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

def to_location
  @to_location
end