Class: TagMangler
- Inherits:
-
Object
- Object
- TagMangler
- Defined in:
- lib/chili_pdf/tag_mangler.rb
Instance Method Summary collapse
-
#initialize(src, request_like_object = nil) ⇒ TagMangler
constructor
A new instance of TagMangler.
- #to_absolute_url ⇒ Object
- #to_local_src ⇒ Object
Constructor Details
#initialize(src, request_like_object = nil) ⇒ TagMangler
Returns a new instance of TagMangler.
2 3 4 5 |
# File 'lib/chili_pdf/tag_mangler.rb', line 2 def initialize(src, request_like_object = nil) @src_attribute = src # /roy @request_like = request_like_object end |
Instance Method Details
#to_absolute_url ⇒ Object
11 12 13 |
# File 'lib/chili_pdf/tag_mangler.rb', line 11 def to_absolute_url relative_url? ? "#{base_url}#{relative_url}" : @src_attribute end |
#to_local_src ⇒ Object
7 8 9 |
# File 'lib/chili_pdf/tag_mangler.rb', line 7 def to_local_src full_file_path.blank? ? @src_attribute : "file://#{full_file_path}" end |