Class: ActiveScaffold::Config::Export
- Inherits:
-
Form
- Object
- Form
- ActiveScaffold::Config::Export
- Defined in:
- lib/active_scaffold/config/export.rb
Constant Summary collapse
- @@link =
ActiveScaffold::DataStructures::ActionLink.new('show_export', :label => :export, :type => :collection, :security_method => :export_authorized?)
- @@plugin_directory =
Instance Attribute Summary collapse
- #allow_full_download ⇒ Object
- #default_delimiter ⇒ Object
- #default_deselected_columns ⇒ Object
- #default_file_format ⇒ Object
- #default_full_download ⇒ Object
- #default_skip_header ⇒ Object
- #force_quotes ⇒ Object
- #link ⇒ Object
- #show_form ⇒ Object
Instance Method Summary collapse
-
#initialize(core_config) ⇒ Export
constructor
A new instance of Export.
- #multipart? ⇒ Boolean
- #xlsx_present? ⇒ Boolean
Constructor Details
#initialize(core_config) ⇒ Export
Returns a new instance of Export.
5 6 7 8 |
# File 'lib/active_scaffold/config/export.rb', line 5 def initialize(core_config) @core = core_config @formats = [:csv, :xlsx] end |
Instance Attribute Details
#allow_full_download ⇒ Object
38 39 40 41 |
# File 'lib/active_scaffold/config/export.rb', line 38 def allow_full_download self.allow_full_download = @core.export_allow_full_download if @allow_full_download.nil? @allow_full_download end |
#default_delimiter ⇒ Object
50 51 52 53 |
# File 'lib/active_scaffold/config/export.rb', line 50 def default_delimiter self.default_delimiter = @core.export_default_delimiter if @default_delimiter.nil? @default_delimiter end |
#default_deselected_columns ⇒ Object
58 59 60 61 |
# File 'lib/active_scaffold/config/export.rb', line 58 def default_deselected_columns self.default_deselected_columns = [] if @default_deselected_columns.nil? @default_deselected_columns end |
#default_file_format ⇒ Object
62 63 64 65 66 67 68 |
# File 'lib/active_scaffold/config/export.rb', line 62 def default_file_format if @core.export_xlsx_avaliable self.default_file_format = @default_file_format || 'xlsx' else self.default_file_format = @default_file_format || @core.export_default_file_format end end |
#default_full_download ⇒ Object
46 47 48 49 |
# File 'lib/active_scaffold/config/export.rb', line 46 def default_full_download self.default_full_download = @core.export_default_full_download if @default_full_download.nil? @default_full_download end |
#default_skip_header ⇒ Object
54 55 56 57 |
# File 'lib/active_scaffold/config/export.rb', line 54 def default_skip_header self.default_skip_header = @core.export_default_skip_header if @default_skip_header.nil? @default_skip_header end |
#force_quotes ⇒ Object
42 43 44 45 |
# File 'lib/active_scaffold/config/export.rb', line 42 def force_quotes self.force_quotes = @core.export_force_quotes if @force_quotes.nil? @force_quotes end |
#link ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/active_scaffold/config/export.rb', line 25 def link @link ||= if show_form self.class.link.clone else ActiveScaffold::DataStructures::ActionLink.new('export', :label => :export, :type => :collection, :inline => false, :security_method => :export_authorized?) end end |
#show_form ⇒ Object
34 35 36 37 |
# File 'lib/active_scaffold/config/export.rb', line 34 def show_form self.show_form = @core.export_show_form if @show_form.nil? @show_form end |
Instance Method Details
#multipart? ⇒ Boolean
75 76 77 |
# File 'lib/active_scaffold/config/export.rb', line 75 def multipart? false end |
#xlsx_present? ⇒ Boolean
69 70 71 |
# File 'lib/active_scaffold/config/export.rb', line 69 def xlsx_present? Gem::Specification::find_all_by_name('axlsx_rails').any? end |