Module: PlainRecord

Defined in:
lib/plain_record/file.rb,
lib/plain_record.rb,
lib/plain_record/type.rb,
lib/plain_record/model.rb,
lib/plain_record/default.rb,
lib/plain_record/version.rb,
lib/plain_record/filepath.rb,
lib/plain_record/resource.rb,
lib/plain_record/callbacks.rb,
lib/plain_record/model/list.rb,
lib/plain_record/model/entry.rb,
lib/plain_record/associations.rb,
lib/plain_record/association_proxy.rb

Overview

Storage for one-to-many virtual associations.

Copyright © 2009 Andrey “A.I.” Sitnik <[email protected]>, sponsored by Evil Martians.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program. If not, see <www.gnu.org/licenses/>.

Defined Under Namespace

Modules: Associations, Callbacks, Default, Extra, File, Filepath, Model, RailsController, Resource, Type Classes: AssociationProxy

Constant Summary collapse

VERSION =
'0.4'

Class Method Summary collapse

Class Method Details

.root(path = '') ⇒ Object

Return root for Model#entry_in or Model#list_in.

If you set path it will be added to root path.



59
60
61
# File 'lib/plain_record.rb', line 59

def root(path = '')
  ::File.join(@root, path)
end

.root=(value) ⇒ Object

Set new root for Model#entry_in or Model#list_in.

Note, that it add last slash to root path (/content will be saved as /content/).



50
51
52
53
54
# File 'lib/plain_record.rb', line 50

def root=(value)
  value  = value.to_s
  value += ::File::SEPARATOR if ::File::SEPARATOR != value[-1..-1]
  @root  = value
end