Class: Models::BaseFile
- Inherits:
-
Object
- Object
- Models::BaseFile
- Defined in:
- lib/kit/models/base_file.rb
Direct Known Subclasses
Instance Method Summary collapse
- #build_path(name, version = nil) ⇒ Object
- #build_url(name, version = nil) ⇒ Object
-
#model_id ⇒ Object
def sanitize_regexp /[^[:word:].-+s_]/i end.
Instance Method Details
#build_path(name, version = nil) ⇒ Object
15 16 17 |
# File 'lib/kit/models/base_file.rb', line 15 def build_path name, version = nil "#{rad.models.fs['prefix']}/system/#{model.class.alias.underscore}/#{model_id}" + build_standard_path(name, version) end |
#build_url(name, version = nil) ⇒ Object
19 20 21 |
# File 'lib/kit/models/base_file.rb', line 19 def build_url name, version = nil "#{rad.models.fs['host']}#{rad.models.fs['prefix']}/system/#{model.class.alias.underscore}/#{model_id}" + build_standard_url(name, version) end |
#model_id ⇒ Object
def sanitize_regexp
/[^[:word:]\.\-\+\s_]/i
end
11 12 13 |
# File 'lib/kit/models/base_file.rb', line 11 def model_id model._id || model._parent._id || raise("id not defined!") end |