Class: AmCharts::ExportSettings

Inherits:
Object
  • Object
show all
Defined in:
lib/amcharts/export_settings.rb

Defined Under Namespace

Classes: Menu

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ ExportSettings

Returns a new instance of ExportSettings.



32
33
34
35
36
# File 'lib/amcharts/export_settings.rb', line 32

def initialize(&block)
  @settings = Settings.new
  @menus = Collection[Menu]
  instance_exec(self, &block) if block_given?
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args, &block) ⇒ Object (private)



49
50
51
# File 'lib/amcharts/export_settings.rb', line 49

def method_missing(name, *args, &block)
  @settings.send(name, *args, &block)
end

Instance Attribute Details

Returns the value of attribute menus.



30
31
32
# File 'lib/amcharts/export_settings.rb', line 30

def menus
  @menus
end

#settingsObject (readonly)

Returns the value of attribute settings.



30
31
32
# File 'lib/amcharts/export_settings.rb', line 30

def settings
  @settings
end

Instance Method Details

#empty?Boolean

Returns:

  • (Boolean)


43
44
45
# File 'lib/amcharts/export_settings.rb', line 43

def empty?
  settings.empty? and menus.empty?
end

#pdf?Boolean

Returns:

  • (Boolean)


38
39
40
41
# File 'lib/amcharts/export_settings.rb', line 38

def pdf?
  return false if menus.empty?
  menus.flat_map(&:formats).any?{ |f| f == :pdf }
end