Module: CartoDB::Model::Getters::ClassMethods

Defined in:
lib/cartodb-rb-client/cartodb/model/getters.rb

Instance Method Summary collapse

Instance Method Details

#cartodb_tableObject



20
21
22
23
24
25
26
# File 'lib/cartodb-rb-client/cartodb/model/getters.rb', line 20

def cartodb_table
  @cartodb_table = begin
    connection.table table_name
  rescue CartoDB::Client::Error
    nil
  end
end

#columnsObject



28
29
30
31
# File 'lib/cartodb-rb-client/cartodb/model/getters.rb', line 28

def columns
  update_cartodb_schema unless schema_synchronized?
  @columns
end

#connectionObject



12
13
14
# File 'lib/cartodb-rb-client/cartodb/model/getters.rb', line 12

def connection
  CartoDB::Connection
end

#data_columnsObject



33
34
35
# File 'lib/cartodb-rb-client/cartodb/model/getters.rb', line 33

def data_columns
  columns.reject{|c| %w(cartodb_id created_at updated_at).include?(c[:name])}.compact
end

#geometry_typeObject



37
38
39
# File 'lib/cartodb-rb-client/cartodb/model/getters.rb', line 37

def geometry_type
  @geometry_type
end

#table_nameObject



16
17
18
# File 'lib/cartodb-rb-client/cartodb/model/getters.rb', line 16

def table_name
  @table_name ||= self.name.tableize
end