Class: CabezaDeTermo::AssetsPublisher::AssetsSource
- Inherits:
-
Object
- Object
- CabezaDeTermo::AssetsPublisher::AssetsSource
- Defined in:
- lib/cabeza-de-termo/assets-publisher/source-finders/assets-source.rb
Class Method Summary collapse
-
.on(folder) ⇒ Object
Class methods.
Instance Method Summary collapse
- #asset_path_of(uri) ⇒ Object
- #folder ⇒ Object
- #has_asset?(uri) ⇒ Boolean
-
#initialize(folder) ⇒ AssetsSource
constructor
Instance methods.
Constructor Details
#initialize(folder) ⇒ AssetsSource
Instance methods
14 15 16 |
# File 'lib/cabeza-de-termo/assets-publisher/source-finders/assets-source.rb', line 14 def initialize(folder) @folder = Pathname.new(folder) end |
Class Method Details
.on(folder) ⇒ Object
Class methods
8 9 10 |
# File 'lib/cabeza-de-termo/assets-publisher/source-finders/assets-source.rb', line 8 def self.on(folder) new(folder) end |
Instance Method Details
#asset_path_of(uri) ⇒ Object
26 27 28 |
# File 'lib/cabeza-de-termo/assets-publisher/source-finders/assets-source.rb', line 26 def asset_path_of(uri) folder + uri end |
#folder ⇒ Object
18 19 20 |
# File 'lib/cabeza-de-termo/assets-publisher/source-finders/assets-source.rb', line 18 def folder @folder end |
#has_asset?(uri) ⇒ Boolean
22 23 24 |
# File 'lib/cabeza-de-termo/assets-publisher/source-finders/assets-source.rb', line 22 def has_asset?(uri) asset_path_of(uri).file? end |