class Telerivet::DataRow
Represents a row in a custom data table.
For example, each response to a poll is stored as one row in a data table. If a poll has a question with ID 'q1', the verbatim response to that question would be stored in row.vars.q1, and the response code would be stored in row.vars.q1_code.
Each custom variable name within a data row corresponds to a different column/field of the data table.
Fields:
- id (string, max 34 characters) * ID of the data row * Read-only - contact_id * ID of the contact this row is associated with (or null if not associated with any contact) * Updatable via API - from_number (string) * Phone number that this row is associated with (or null if not associated with any phone number) * Updatable via API - vars (Hash) * Custom variables stored for this data row * Updatable via API - time_created (UNIX timestamp) * The time this row was created in Telerivet * Read-only - time_updated (UNIX timestamp) * The time this row was last updated in Telerivet * Read-only - table_id * ID of the table this data row belongs to * Read-only - project_id * ID of the project this data row belongs to * Read-only
Public Instance Methods
contact_id()
click to toggle source
# File lib/telerivet/datarow.rb, line 69 def contact_id get('contact_id') end
contact_id=(value)
click to toggle source
# File lib/telerivet/datarow.rb, line 73 def contact_id=(value) set('contact_id', value) end
delete()
click to toggle source
Deletes this data row.
# File lib/telerivet/datarow.rb, line 61 def delete() @api.do_request("DELETE", get_base_api_path()) end
from_number()
click to toggle source
# File lib/telerivet/datarow.rb, line 77 def from_number get('from_number') end
from_number=(value)
click to toggle source
# File lib/telerivet/datarow.rb, line 81 def from_number=(value) set('from_number', value) end
get_base_api_path()
click to toggle source
# File lib/telerivet/datarow.rb, line 101 def get_base_api_path() "/projects/#{get('project_id')}/tables/#{get('table_id')}/rows/#{get('id')}" end
id()
click to toggle source
# File lib/telerivet/datarow.rb, line 65 def id get('id') end
project_id()
click to toggle source
# File lib/telerivet/datarow.rb, line 97 def project_id get('project_id') end
save()
click to toggle source
Saves any fields or custom variables that have changed for this data row.
Calls superclass method
# File lib/telerivet/datarow.rb, line 54 def save() super end
table_id()
click to toggle source
# File lib/telerivet/datarow.rb, line 93 def table_id get('table_id') end
time_created()
click to toggle source
# File lib/telerivet/datarow.rb, line 85 def time_created get('time_created') end
time_updated()
click to toggle source
# File lib/telerivet/datarow.rb, line 89 def time_updated get('time_updated') end