Class: Cohere::Transcribe::State::SourceSnapshot
- Inherits:
-
Data
- Object
- Data
- Cohere::Transcribe::State::SourceSnapshot
- Defined in:
- lib/cohere/transcribe/state/io.rb
Instance Attribute Summary collapse
-
#canonical_path ⇒ Object
readonly
Returns the value of attribute canonical_path.
-
#ctime_ns ⇒ Object
readonly
Returns the value of attribute ctime_ns.
-
#device ⇒ Object
readonly
Returns the value of attribute device.
-
#inode ⇒ Object
readonly
Returns the value of attribute inode.
-
#mtime_ns ⇒ Object
readonly
Returns the value of attribute mtime_ns.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#canonical_path ⇒ Object (readonly)
Returns the value of attribute canonical_path
323 324 325 |
# File 'lib/cohere/transcribe/state/io.rb', line 323 def canonical_path @canonical_path end |
#ctime_ns ⇒ Object (readonly)
Returns the value of attribute ctime_ns
323 324 325 |
# File 'lib/cohere/transcribe/state/io.rb', line 323 def ctime_ns @ctime_ns end |
#device ⇒ Object (readonly)
Returns the value of attribute device
323 324 325 |
# File 'lib/cohere/transcribe/state/io.rb', line 323 def device @device end |
#inode ⇒ Object (readonly)
Returns the value of attribute inode
323 324 325 |
# File 'lib/cohere/transcribe/state/io.rb', line 323 def inode @inode end |
#mtime_ns ⇒ Object (readonly)
Returns the value of attribute mtime_ns
323 324 325 |
# File 'lib/cohere/transcribe/state/io.rb', line 323 def mtime_ns @mtime_ns end |
#size ⇒ Object (readonly)
Returns the value of attribute size
323 324 325 |
# File 'lib/cohere/transcribe/state/io.rb', line 323 def size @size end |
Class Method Details
.capture(path) ⇒ Object
331 332 333 334 335 336 337 338 339 340 341 342 |
# File 'lib/cohere/transcribe/state/io.rb', line 331 def self.capture(path) canonical = Pathname(path).realpath stat = canonical.stat new( canonical_path: canonical.to_s.freeze, device: stat.dev, inode: stat.ino, size: stat.size, mtime_ns: State.time_nanoseconds(stat.mtime), ctime_ns: State.time_nanoseconds(stat.ctime) ) end |
Instance Method Details
#payload ⇒ Object
344 345 346 347 348 349 350 351 352 353 354 355 |
# File 'lib/cohere/transcribe/state/io.rb', line 344 def payload { "canonical_path" => canonical_path, "snapshot" => { "device" => device, "inode" => inode, "size" => size, "mtime_ns" => mtime_ns, "ctime_ns" => ctime_ns } } end |