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 =
File.(__FILE__).match(%{(^.*)/lib/active_scaffold/config/export.rb})[1]
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 |
# File 'lib/active_scaffold/config/export.rb', line 5 def initialize(core_config) @core = core_config end |
Instance Attribute Details
#allow_full_download ⇒ Object
37 38 39 40 |
# File 'lib/active_scaffold/config/export.rb', line 37 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
49 50 51 52 |
# File 'lib/active_scaffold/config/export.rb', line 49 def default_delimiter self.default_delimiter = @core.export_default_delimiter if @default_delimiter.nil? @default_delimiter end |
#default_deselected_columns ⇒ Object
57 58 59 60 |
# File 'lib/active_scaffold/config/export.rb', line 57 def default_deselected_columns self.default_deselected_columns = [] if @default_deselected_columns.nil? @default_deselected_columns end |
#default_file_format ⇒ Object
61 62 63 64 65 66 67 |
# File 'lib/active_scaffold/config/export.rb', line 61 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
45 46 47 48 |
# File 'lib/active_scaffold/config/export.rb', line 45 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
53 54 55 56 |
# File 'lib/active_scaffold/config/export.rb', line 53 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
41 42 43 44 |
# File 'lib/active_scaffold/config/export.rb', line 41 def force_quotes self.force_quotes = @core.export_force_quotes if @force_quotes.nil? @force_quotes end |
#link ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/active_scaffold/config/export.rb', line 24 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
33 34 35 36 |
# File 'lib/active_scaffold/config/export.rb', line 33 def show_form self.show_form = @core.export_show_form if @show_form.nil? @show_form end |
Instance Method Details
#multipart? ⇒ Boolean
74 75 76 |
# File 'lib/active_scaffold/config/export.rb', line 74 def multipart? false end |
#xlsx_present? ⇒ Boolean
68 69 70 |
# File 'lib/active_scaffold/config/export.rb', line 68 def xlsx_present? Gem::Specification::find_all_by_name('axlsx_rails').any? end |