Class: Troo::CommentPersistence
- Inherits:
-
Object
- Object
- Troo::CommentPersistence
- Defined in:
- lib/troo/models/comment_persistence.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(resource, options = {}) ⇒ CommentPersistence
constructor
A new instance of CommentPersistence.
- #persist ⇒ Object
Constructor Details
#initialize(resource, options = {}) ⇒ CommentPersistence
Returns a new instance of CommentPersistence.
9 10 11 12 |
# File 'lib/troo/models/comment_persistence.rb', line 9 def initialize(resource, = {}) @resource = resource @options = end |
Class Method Details
.for(resource, options = {}) ⇒ Object
4 5 6 |
# File 'lib/troo/models/comment_persistence.rb', line 4 def for(resource, = {}) new(resource, ).persist end |
Instance Method Details
#persist ⇒ Object
14 15 16 17 18 |
# File 'lib/troo/models/comment_persistence.rb', line 14 def persist return local if local_identical? return updated if local_exists? return created end |