Class: CartoDB::Model::Base

Inherits:
Object show all
Includes:
Geo, Getters, Persistence, Query, Schema, Setters, RGeo::Feature
Defined in:
lib/cartodb-rb-client/cartodb/model/base.rb

Constant Summary

Constants included from Constants

Constants::CARTODB_TYPES, Constants::DEFAULT_ROWS_PER_PAGE, Constants::GEOMETRY_COLUMN, Constants::INVALID_COLUMNS, Constants::RGEO_FACTORY

Instance Attribute Summary

Attributes included from Getters

#attributes, #table

Instance Method Summary collapse

Methods included from Query

#count, #count=, included

Methods included from Persistence

#destroy, included, #new_record?, #save

Methods included from Schema

#cartodb_table_exists?, included, #schema_synchronized?

Methods included from Geo

#convert_to_point, included

Methods included from Setters

#attributes=, #cartodb_table=, included

Methods included from Getters

#cartodb_table, #columns, #connection, included, #table_name

Constructor Details

#initialize(attributes = {}) ⇒ Base

Returns a new instance of Base.



12
13
14
15
16
17
# File 'lib/cartodb-rb-client/cartodb/model/base.rb', line 12

def initialize(attributes = {})
  self.class.cartodb_table = nil
  self.class.send(:set_geometry_type) unless self.class.send(:geometry_type).present?
  self.attributes = attributes
  self.class.send(:update_cartodb_schema) unless schema_synchronized?
end