Module: BreezyPDF

Extended by:
Util
Defined in:
lib/breezy_pdf.rb,
lib/breezy_pdf/gzip.rb,
lib/breezy_pdf/util.rb,
lib/breezy_pdf/_html.rb,
lib/breezy_pdf/_cache.rb,
lib/breezy_pdf/client.rb,
lib/breezy_pdf/version.rb,
lib/breezy_pdf/_uploads.rb,
lib/breezy_pdf/response.rb,
lib/breezy_pdf/_intercept.rb,
lib/breezy_pdf/_resources.rb,
lib/breezy_pdf/html_2_pdf.rb,
lib/breezy_pdf/middleware.rb,
lib/breezy_pdf/interceptor.rb,
lib/breezy_pdf/render_request.rb

Overview

:nodoc

Defined Under Namespace

Modules: Cache, Gzip, HTML, Intercept, Resources, Uploads, Util Classes: Client, HTML2PDF, Interceptor, Middleware, RenderRequest, Response

Constant Summary collapse

BreezyPDFError =
Class.new(StandardError)
AuthError =
Class.new(BreezyPDFError)
VERSION =
"1.0.2"
@@secret_api_key =
nil
@@base_url =
"https://breezypdf.com/api"
@@middleware_path_matchers =
[/\.pdf/]
@@treat_urls_as_private =
true
@@upload_assets =
true
@@asset_selectors =
%w(img script link[rel="stylesheet"])
@@asset_path_matchers =
{
  href: %r{^\/\w+},
  src:  %r{^\/\w+}
}
@@asset_cache =
Cache::Null.new
@@extract_metadata =
true
@@threads =
1
@@filter_elements =
false
@@filtered_element_selectors =
%w[.breezy-pdf-remove]
@@default_metadata =
{
  # width:             8.5,
  # height:            11,
  # cssPageSize:       false,
  # marginTop:         0.4,
  # marginRight:       0.4,
  # marginBottom:      0.4,
  # marginLeft:        0.4,
  # landscape:         false,
  # scale:             1,
  # displayBackground: false,
  # headerTemplate:    "",
  # footerTemplate:    ""
}
@@logger =
Logger.new(STDOUT)

Class Method Summary collapse

Methods included from Util

mattr_accessor, mattr_reader, mattr_writer

Class Method Details

.default_metadataObject

Support proper merging of hash rocket and symbol keys


104
105
106
# File 'lib/breezy_pdf.rb', line 104

def self.
  @@jsonified_metadata ||= JSON.parse(@@default_metadata.to_json)
end

.setup {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:

  • _self (BreezyPDF)

    the object that the method was called on


99
100
101
# File 'lib/breezy_pdf.rb', line 99

def self.setup
  yield self
end