Class: ImageDiff::Snapshot
- Inherits:
-
Object
- Object
- ImageDiff::Snapshot
- Defined in:
- lib/image_diff/snapshot.rb
Overview
Snapshot class
Direct Known Subclasses
Class Attribute Summary collapse
-
.id ⇒ Object
readonly
Returns the value of attribute id.
Instance Attribute Summary collapse
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#snapshot_path ⇒ Object
readonly
Returns the value of attribute snapshot_path.
Instance Method Summary collapse
- #filename ⇒ Object
- #filepath ⇒ Object
- #fullpath ⇒ Object
-
#initialize(snapshot_path, file) ⇒ Snapshot
constructor
A new instance of Snapshot.
Methods included from Differ
Methods included from Writer
Constructor Details
#initialize(snapshot_path, file) ⇒ Snapshot
Returns a new instance of Snapshot.
18 19 20 21 |
# File 'lib/image_diff/snapshot.rb', line 18 def initialize(snapshot_path, file) @snapshot_path = snapshot_path @file = file end |
Class Attribute Details
.id ⇒ Object (readonly)
Returns the value of attribute id.
13 14 15 |
# File 'lib/image_diff/snapshot.rb', line 13 def id @id end |
Instance Attribute Details
#file ⇒ Object (readonly)
Returns the value of attribute file.
16 17 18 |
# File 'lib/image_diff/snapshot.rb', line 16 def file @file end |
#snapshot_path ⇒ Object (readonly)
Returns the value of attribute snapshot_path.
16 17 18 |
# File 'lib/image_diff/snapshot.rb', line 16 def snapshot_path @snapshot_path end |
Instance Method Details
#filename ⇒ Object
31 32 33 |
# File 'lib/image_diff/snapshot.rb', line 31 def filename "#{@file}#{extension}" end |
#filepath ⇒ Object
27 28 29 |
# File 'lib/image_diff/snapshot.rb', line 27 def filepath File.join(fullpath, @file) end |
#fullpath ⇒ Object
23 24 25 |
# File 'lib/image_diff/snapshot.rb', line 23 def fullpath FileUtils.mkdir_p(snapshot_path) end |