Class: Pageflow::UsedFile
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Pageflow::UsedFile
- Defined in:
- app/models/pageflow/used_file.rb
Instance Method Summary collapse
- #configuration ⇒ Object
-
#initialize(file, usage = nil) ⇒ UsedFile
constructor
A new instance of UsedFile.
- #update_attributes!(attributes) ⇒ Object
- #usage_id ⇒ Object
Constructor Details
#initialize(file, usage = nil) ⇒ UsedFile
Returns a new instance of UsedFile.
3 4 5 6 |
# File 'app/models/pageflow/used_file.rb', line 3 def initialize(file, usage = nil) super(file) @usage = usage || file.usages.first end |
Instance Method Details
#configuration ⇒ Object
8 9 10 |
# File 'app/models/pageflow/used_file.rb', line 8 def configuration @usage.configuration end |
#update_attributes!(attributes) ⇒ Object
12 13 14 15 |
# File 'app/models/pageflow/used_file.rb', line 12 def update_attributes!(attributes) super(attributes.except(:configuration)) @usage.update_attributes!(attributes.slice(:configuration)) end |
#usage_id ⇒ Object
17 18 19 |
# File 'app/models/pageflow/used_file.rb', line 17 def usage_id @usage.id end |