Class: ActiveRecord::Base
- Inherits:
-
Object
- Object
- ActiveRecord::Base
- Defined in:
- lib/ar_dumper_active_record.rb
Overview
Refer to ArDumper for ActiveRecord extensions
Class Method Summary collapse
-
.dump_to_yaml(options = {}) ⇒ Object
Dump to yml Same as
ActiveRecord::Base.dumper :yml
. -
.dumper(format, options = {}) ⇒ Object
Dump data *
format
- type of dump (:csv
,:yml
,:xml
) *options
- Dumper options. -
.dumper_to_string(format, options = {}) ⇒ Object
Dump to string.
-
.to_csv(options = {}) ⇒ Object
Dump to csv string Same as
ActiveRecord::Base.dumper :csv, :target_type => :string
.
Class Method Details
.dump_to_yaml(options = {}) ⇒ Object
Dump to yml Same as ActiveRecord::Base.dumper :yml
12 13 14 |
# File 'lib/ar_dumper_active_record.rb', line 12 def self.dump_to_yaml(={}) dumper :yml, end |
.dumper(format, options = {}) ⇒ Object
Dump data
-
format
- type of dump (:csv
,:yml
,:xml
) -
options
- Dumper options. Refer to ArDumper
19 20 21 |
# File 'lib/ar_dumper_active_record.rb', line 19 def self.dumper(format, ={}) ArDumper.new(self, ).dump(format) end |
.dumper_to_string(format, options = {}) ⇒ Object
Dump to string. Same as ActiveRecord::Base.dumper format, :target_type => :string
25 26 27 |
# File 'lib/ar_dumper_active_record.rb', line 25 def self.dumper_to_string(format, ={}) dumper(format, .update({:target_type => :string})) end |
.to_csv(options = {}) ⇒ Object
Dump to csv string Same as ActiveRecord::Base.dumper :csv, :target_type => :string
6 7 8 |
# File 'lib/ar_dumper_active_record.rb', line 6 def self.to_csv(={}) dump_to_string :csv, end |