Class: Arclight::DocumentDownloads::File
- Inherits:
-
Object
- Object
- Arclight::DocumentDownloads::File
- Defined in:
- app/models/arclight/document_downloads.rb
Overview
Model a single file configured in downloads.yml
Instance Attribute Summary collapse
-
#document ⇒ Object
readonly
Returns the value of attribute document.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #href ⇒ Object
-
#initialize(type:, data:, document:) ⇒ File
constructor
A new instance of File.
- #size ⇒ Object
Constructor Details
#initialize(type:, data:, document:) ⇒ File
Returns a new instance of File.
58 59 60 61 62 |
# File 'app/models/arclight/document_downloads.rb', line 58 def initialize(type:, data:, document:) @type = type @data = data @document = document end |
Instance Attribute Details
#document ⇒ Object (readonly)
Returns the value of attribute document.
56 57 58 |
# File 'app/models/arclight/document_downloads.rb', line 56 def document @document end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
56 57 58 |
# File 'app/models/arclight/document_downloads.rb', line 56 def type @type end |
Instance Method Details
#href ⇒ Object
64 65 66 67 68 |
# File 'app/models/arclight/document_downloads.rb', line 64 def href return data['href'] if data['href'] format_template end |
#size ⇒ Object
70 71 72 73 74 |
# File 'app/models/arclight/document_downloads.rb', line 70 def size return data['size'] if data['size'] document.public_send(data['size_accessor'].to_sym) if data['size_accessor'] end |