Class: Sendl::File
- Inherits:
-
Object
- Object
- Sendl::File
- Defined in:
- lib/sendl/file.rb
Instance Attribute Summary collapse
-
#desired_name ⇒ Object
readonly
Returns the value of attribute desired_name.
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
Instance Method Summary collapse
-
#initialize(file, override_name = nil) ⇒ File
constructor
A new instance of File.
- #sha512 ⇒ Object
Constructor Details
#initialize(file, override_name = nil) ⇒ File
Returns a new instance of File.
5 6 7 8 9 |
# File 'lib/sendl/file.rb', line 5 def initialize(file, override_name = nil) @desired_name = ::File.basename(override_name || file) @filename = file @size = ::File.size(file) end |
Instance Attribute Details
#desired_name ⇒ Object (readonly)
Returns the value of attribute desired_name.
3 4 5 |
# File 'lib/sendl/file.rb', line 3 def desired_name @desired_name end |
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
3 4 5 |
# File 'lib/sendl/file.rb', line 3 def filename @filename end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
3 4 5 |
# File 'lib/sendl/file.rb', line 3 def size @size end |
Instance Method Details
#sha512 ⇒ Object
11 12 13 14 |
# File 'lib/sendl/file.rb', line 11 def sha512 @sha512 ||= generate_sha512 @sha512 end |