Module: Pageflow::HostedFile
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary
collapse
#cache_key, #direct_upload_config, #file_type, #nested_files, #parent_allows_type_for_nesting, #parent_belongs_to_same_entry
Instance Method Details
#attachment ⇒ Object
41
42
43
|
# File 'app/models/concerns/pageflow/hosted_file.rb', line 41
def attachment
attachment_on_s3
end
|
#attachment=(value) ⇒ Object
45
46
47
|
# File 'app/models/concerns/pageflow/hosted_file.rb', line 45
def attachment=(value)
self.attachment_on_s3 = value
end
|
#attachment_default_url ⇒ Object
49
50
51
|
# File 'app/models/concerns/pageflow/hosted_file.rb', line 49
def attachment_default_url
''
end
|
#attachment_styles(_attachment) ⇒ Object
53
54
55
|
# File 'app/models/concerns/pageflow/hosted_file.rb', line 53
def attachment_styles(_attachment)
{}
end
|
#basename ⇒ Object
69
70
71
|
# File 'app/models/concerns/pageflow/hosted_file.rb', line 69
def basename
File.basename(attachment.original_filename, '.*')
end
|
#can_upload? ⇒ Boolean
57
58
59
|
# File 'app/models/concerns/pageflow/hosted_file.rb', line 57
def can_upload?
uploading?
end
|
#original_url ⇒ Object
79
80
81
|
# File 'app/models/concerns/pageflow/hosted_file.rb', line 79
def original_url
url
end
|
#ready? ⇒ Boolean
65
66
67
|
# File 'app/models/concerns/pageflow/hosted_file.rb', line 65
def ready?
attachment.present?
end
|
#retryable? ⇒ Boolean
61
62
63
|
# File 'app/models/concerns/pageflow/hosted_file.rb', line 61
def retryable?
false
end
|
#url ⇒ Object
73
74
75
76
77
|
# File 'app/models/concerns/pageflow/hosted_file.rb', line 73
def url
if attachment.present?
attachment.url
end
end
|