class CouchdbToSql::TableOperator
Abstract base class for classes which performs table operations (build, destroy, upsert, etc.)
Attributes
parent[R]
@return [DocumentHandler]
primary_key[R]
@return [Symbol]
table_name[R]
@return [String]
Public Class Methods
new(parent, table_name, opts = {})
click to toggle source
# File lib/couchdb_to_sql/table_operator.rb, line 17 def initialize(parent, table_name, opts = {}) @parent = parent @table_name = table_name deduce_primary_key(opts) end
Public Instance Methods
deduce_primary_key(opts)
click to toggle source
# File lib/couchdb_to_sql/table_operator.rb, line 24 def deduce_primary_key(opts) @primary_key = (opts[:primary_key] || "#{@table_name.to_s.singularize}_id").to_sym end
execute()
click to toggle source
# File lib/couchdb_to_sql/table_operator.rb, line 32 def execute raise NotImplementedError, "Classes deriving from #{self} must implement the 'execute' method." end
handler()
click to toggle source
# File lib/couchdb_to_sql/table_operator.rb, line 28 def handler parent.handler end