Module: Ripple::Conversion
- Includes:
- ActiveModel::Conversion
- Defined in:
- ripple/lib/ripple/conversion.rb
Overview
Provides ActionPack compatibility for Document models.
Instance Method Summary (collapse)
-
- (Boolean) new_record?
True if this is a new document.
-
- (Boolean) persisted?
True if this is not a new document.
-
- (Object) to_key
Converts to a view key.
-
- (Object) to_param
Converts to a URL parameter.
Instance Method Details
- (Boolean) new_record?
True if this is a new document
23 24 25 |
# File 'ripple/lib/ripple/conversion.rb', line 23 def new_record? new? end |
- (Boolean) persisted?
True if this is not a new document
28 29 30 |
# File 'ripple/lib/ripple/conversion.rb', line 28 def persisted? !new? end |
- (Object) to_key
Converts to a view key
33 34 35 |
# File 'ripple/lib/ripple/conversion.rb', line 33 def to_key new? ? nil : [key] end |
- (Object) to_param
Converts to a URL parameter
38 39 40 |
# File 'ripple/lib/ripple/conversion.rb', line 38 def to_param key end |