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.
61 62 63 64 65 |
# File 'app/models/arclight/document_downloads.rb', line 61 def initialize(type:, data:, document:) @type = type @data = data @document = document end |
Instance Attribute Details
#document ⇒ Object (readonly)
Returns the value of attribute document.
60 61 62 |
# File 'app/models/arclight/document_downloads.rb', line 60 def document @document end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
60 61 62 |
# File 'app/models/arclight/document_downloads.rb', line 60 def type @type end |
Instance Method Details
#href ⇒ Object
67 68 69 70 71 |
# File 'app/models/arclight/document_downloads.rb', line 67 def href return data['href'] if data['href'] format_template end |
#size ⇒ Object
73 74 75 76 77 |
# File 'app/models/arclight/document_downloads.rb', line 73 def size return data['size'] if data['size'] document.send(data['size_accessor'].to_sym) if data['size_accessor'] end |