Module: Ladder::File
- Extended by:
- ActiveSupport::Concern
- Includes:
- ActiveTriples::Identifiable, Configurable, 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 ⇒ String
Output content of object from stored file or readable input.
-
#update_resource ⇒ ActiveTriples::Resource
Return an empty ActiveTriples resource for serializing related resources.
Instance Attribute Details
#file ⇒ Object
Returns the value of attribute file.
35 36 37 |
# File 'lib/ladder/file.rb', line 35 def file @file end |
Instance Method Details
#data ⇒ String
Output content of object from stored file or readable input
41 42 43 44 45 46 47 |
# File 'lib/ladder/file.rb', line 41 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 ⇒ ActiveTriples::Resource
Return an empty ActiveTriples resource for serializing related resources
53 54 55 |
# File 'lib/ladder/file.rb', line 53 def update_resource resource end |