Class: Object

Inherits:
BasicObject
Defined in:
lib/squealer/object.rb

Instance Method Summary collapse

Instance Method Details

#assign(column_name, &block) ⇒ Object



7
8
9
# File 'lib/squealer/object.rb', line 7

def assign(column_name, &block)
  Squealer::Target.current.assign(column_name, &block)
end

#export(*args) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/squealer/object.rb', line 19

def export(*args)
  if args.length > 0
    Squealer::Database.instance.export_to(*args)
  else
    Squealer::Database.instance.export
  end
end

#import(*args) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/squealer/object.rb', line 11

def import(*args)
  if args.length > 0
    Squealer::Database.instance.import_from(*args)
  else
    Squealer::Database.instance.import
  end
end

#target(table_name, &block) ⇒ Object



3
4
5
# File 'lib/squealer/object.rb', line 3

def target(table_name, &block)
  Squealer::Target.new(Squealer::Database.instance.export, table_name, &block)
end