Module: Pageflow::HostedFile
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary
collapse
#cache_key, #file_type, #nested_files, #parent_allows_type_for_nesting, #parent_belongs_to_same_entry
Instance Method Details
#attachment ⇒ Object
42
43
44
|
# File 'app/models/concerns/pageflow/hosted_file.rb', line 42
def attachment
attachment_on_s3.present? ? attachment_on_s3 : attachment_on_filesystem
end
|
#attachment=(value) ⇒ Object
46
47
48
|
# File 'app/models/concerns/pageflow/hosted_file.rb', line 46
def attachment=(value)
self.attachment_on_filesystem = value
end
|
#basename ⇒ Object
58
59
60
|
# File 'app/models/concerns/pageflow/hosted_file.rb', line 58
def basename
File.basename(attachment.original_filename, '.*')
end
|
#original_url ⇒ Object
68
69
70
|
# File 'app/models/concerns/pageflow/hosted_file.rb', line 68
def original_url
url
end
|
#ready? ⇒ Boolean
54
55
56
|
# File 'app/models/concerns/pageflow/hosted_file.rb', line 54
def ready?
attachment_on_s3.present?
end
|
#retryable? ⇒ Boolean
50
51
52
|
# File 'app/models/concerns/pageflow/hosted_file.rb', line 50
def retryable?
can_retry?
end
|
#url ⇒ Object
62
63
64
65
66
|
# File 'app/models/concerns/pageflow/hosted_file.rb', line 62
def url
if attachment_on_s3.present?
attachment.url
end
end
|