Module: Ladder::File
- Extended by:
- ActiveSupport::Concern
- Includes:
- ActiveTriples::Identifiable, Mongoid::Document
- Defined in:
- lib/ladder/file.rb
Defined Under Namespace
Modules: ClassMethods
Instance Attribute Summary collapse
-
#file ⇒ Object
Returns the value of attribute file.
Instance Method Summary collapse
-
#data ⇒ Object
Output content of object from stored file or readable input.
-
#update_resource ⇒ Object
Return an empty ActiveTriples resource for serializing related resources.
Instance Attribute Details
#file ⇒ Object
Returns the value of attribute file.
25 26 27 |
# File 'lib/ladder/file.rb', line 25 def file @file end |
Instance Method Details
#data ⇒ Object
Output content of object from stored file or readable input
29 30 31 32 33 34 35 |
# File 'lib/ladder/file.rb', line 29 def data @grid_file ||= self.class.grid.get(id) if persisted? return @grid_file.data if @grid_file file.rewind if file.respond_to? :rewind file.read end |
#update_resource ⇒ Object
Return an empty ActiveTriples resource for serializing related resources
39 40 41 |
# File 'lib/ladder/file.rb', line 39 def update_resource resource end |