mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-16 16:01:41 +00:00
conseguir la ruta al archivo
This commit is contained in:
parent
63f8b869eb
commit
37deb36178
1 changed files with 9 additions and 0 deletions
|
@ -83,6 +83,15 @@ class MetadataFile < MetadataTemplate
|
|||
end
|
||||
end
|
||||
|
||||
# Obtiene la ruta absoluta al archivo
|
||||
#
|
||||
# @return [Pathname]
|
||||
def pathname
|
||||
raise NoMethodError unless uploaded?
|
||||
|
||||
@pathname ||= Pathname.new(File.join(site.path, value['path']))
|
||||
end
|
||||
|
||||
def key_from_path
|
||||
path.dirname.basename.to_s
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue