Class: BreezyPDF::Resources::Asset

Inherits:
Object
  • Object
show all
Defined in:
lib/breezy_pdf/resources/asset.rb

Overview

:nodoc

Instance Method Summary collapse

Constructor Details

#initialize(base_url, asset_path_or_url) ⇒ Asset

Returns a new instance of Asset.



6
7
8
9
# File 'lib/breezy_pdf/resources/asset.rb', line 6

def initialize(base_url, asset_path_or_url)
  @base_url          = base_url
  @asset_path_or_url = asset_path_or_url
end

Instance Method Details

#content_typeObject



11
12
13
# File 'lib/breezy_pdf/resources/asset.rb', line 11

def content_type
  io_object.content_type
end

#file_pathObject



19
20
21
# File 'lib/breezy_pdf/resources/asset.rb', line 19

def file_path
  file.path
end

#filenameObject



15
16
17
# File 'lib/breezy_pdf/resources/asset.rb', line 15

def filename
  @filename ||= URI(asset_url).path.split("/").last
end