Class: ZPdf::Base

Inherits:
AbstractController::Base
  • Object
show all
Includes:
AbstractController::AssetPaths, AbstractController::Helpers, AbstractController::Logger, AbstractController::Rendering, AbstractController::Translation, ActionView::Layouts
Defined in:
lib/zpdf/base.rb

Class Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(method_name, *args) ⇒ Base

Returns a new instance of Base.



88
89
90
91
# File 'lib/zpdf/base.rb', line 88

def initialize(method_name, *args)
  super()
  process(method_name, *args)
end

Class Attribute Details

.generator_nameObject Also known as: controller_path



54
55
56
# File 'lib/zpdf/base.rb', line 54

def generator_name
  @generator_name ||= name.underscore
end

Class Method Details

.default(value = nil) ⇒ Object



60
61
62
63
# File 'lib/zpdf/base.rb', line 60

def default(value = nil)
  self.default_params = default_params.merge(value).freeze if value
  default_params
end

.default_pdf(value = nil) ⇒ Object



65
66
67
68
# File 'lib/zpdf/base.rb', line 65

def default_pdf(value = nil)
  self.default_pdf_params = default_pdf_params.merge(value).freeze if value
  default_pdf_params
end

.respond_to?(method, *args) ⇒ Boolean

Returns:

  • (Boolean)


70
71
72
# File 'lib/zpdf/base.rb', line 70

def respond_to?(method, *args)
  super || action_methods.include?(method.to_s)
end

Instance Method Details

#generate(parameters = {}) ⇒ Object



98
99
100
# File 'lib/zpdf/base.rb', line 98

def generate(parameters={})
  render_html(parameters)
end

#process(*args) ⇒ Object

:nodoc:



93
94
95
96
# File 'lib/zpdf/base.rb', line 93

def process(*args) #:nodoc:
  lookup_context.skip_default_locale! if lookup_context.respond_to?(:skip_default_locale!)
  super
end