Class: Valkyrie::Storage::Shrine::DelayedDownload
- Inherits:
-
Object
- Object
- Valkyrie::Storage::Shrine::DelayedDownload
- Defined in:
- lib/valkyrie/storage/shrine.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#shrine ⇒ Object
readonly
Returns the value of attribute shrine.
Instance Method Summary collapse
- #file ⇒ Object
-
#initialize(shrine, id) ⇒ DelayedDownload
constructor
A new instance of DelayedDownload.
- #method_missing(meth_name, *args, &block) ⇒ Object
- #respond_to_missing?(meth_name, include_private = false) ⇒ Boolean
Constructor Details
#initialize(shrine, id) ⇒ DelayedDownload
Returns a new instance of DelayedDownload.
25 26 27 28 |
# File 'lib/valkyrie/storage/shrine.rb', line 25 def initialize(shrine, id) @shrine = shrine @id = id end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(meth_name, *args, &block) ⇒ Object
34 35 36 37 |
# File 'lib/valkyrie/storage/shrine.rb', line 34 def method_missing(meth_name, *args, &block) return super unless file.respond_to?(meth_name) file.send(meth_name, *args, &block) end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
24 25 26 |
# File 'lib/valkyrie/storage/shrine.rb', line 24 def id @id end |
#shrine ⇒ Object (readonly)
Returns the value of attribute shrine.
24 25 26 |
# File 'lib/valkyrie/storage/shrine.rb', line 24 def shrine @shrine end |
Instance Method Details
#file ⇒ Object
30 31 32 |
# File 'lib/valkyrie/storage/shrine.rb', line 30 def file @file ||= shrine.open(id) end |
#respond_to_missing?(meth_name, include_private = false) ⇒ Boolean
39 40 41 |
# File 'lib/valkyrie/storage/shrine.rb', line 39 def respond_to_missing?(meth_name, include_private = false) file.respond_to?(meth_name) || super end |