Class: IMGKit::Configuration
- Inherits:
-
Object
- Object
- IMGKit::Configuration
- Defined in:
- lib/imgkit/configuration.rb
Instance Attribute Summary collapse
-
#default_format ⇒ Object
Returns the value of attribute default_format.
-
#default_options ⇒ Object
Returns the value of attribute default_options.
-
#meta_tag_prefix ⇒ Object
Returns the value of attribute meta_tag_prefix.
- #wkhtmltoimage ⇒ Object
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
6 7 8 9 10 |
# File 'lib/imgkit/configuration.rb', line 6 def initialize @meta_tag_prefix = 'imgkit-' @default_options = {:height => 0} @default_format = :jpg end |
Instance Attribute Details
#default_format ⇒ Object
Returns the value of attribute default_format.
4 5 6 |
# File 'lib/imgkit/configuration.rb', line 4 def default_format @default_format end |
#default_options ⇒ Object
Returns the value of attribute default_options.
4 5 6 |
# File 'lib/imgkit/configuration.rb', line 4 def @default_options end |
#meta_tag_prefix ⇒ Object
Returns the value of attribute meta_tag_prefix.
4 5 6 |
# File 'lib/imgkit/configuration.rb', line 4 def @meta_tag_prefix end |
#wkhtmltoimage ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/imgkit/configuration.rb', line 12 def wkhtmltoimage @wkhtmltoimage ||= begin path = (using_bundler? ? `bundle exec which wkhtmltoimage` : `which wkhtmltoimage`) path = (path.split("\n").compact.last || "").chomp path = '/usr/local/bin/wkhtmltoimage' if path.strip.empty? # Fallback path end end |