Class: Snaps::Snapshot
- Inherits:
-
Struct
- Object
- Struct
- Snaps::Snapshot
- Defined in:
- lib/snaps/snapshot.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
-
#record ⇒ Object
Returns the value of attribute record.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options
2 3 4 |
# File 'lib/snaps/snapshot.rb', line 2 def end |
#record ⇒ Object
Returns the value of attribute record
2 3 4 |
# File 'lib/snaps/snapshot.rb', line 2 def record @record end |
Class Method Details
.create(record, options, &block) ⇒ Object
3 4 5 |
# File 'lib/snaps/snapshot.rb', line 3 def self.create(record, , &block) new(record, ).create(&block) end |
Instance Method Details
#create {|copy| ... } ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/snaps/snapshot.rb', line 7 def create copy = record.dup yield(copy) if block_given? Tag.suppress do copy.save end copy.snaps_tag!([:tag]) if [:tag] snapshot_components(copy) copy end |