Class: Cabriolet::Models::CHMFile
- Inherits:
-
Object
- Object
- Cabriolet::Models::CHMFile
- Defined in:
- lib/cabriolet/models/chm_file.rb
Overview
Represents a file within a CHM archive
Instance Attribute Summary collapse
-
#filename ⇒ Object
Returns the value of attribute filename.
-
#length ⇒ Object
Returns the value of attribute length.
-
#next_file ⇒ Object
Returns the value of attribute next_file.
-
#offset ⇒ Object
Returns the value of attribute offset.
-
#section ⇒ Object
Returns the value of attribute section.
Instance Method Summary collapse
-
#empty? ⇒ Boolean
Check if this is an empty file.
-
#initialize ⇒ CHMFile
constructor
A new instance of CHMFile.
-
#system_file? ⇒ Boolean
Check if this is a system file (starts with ::).
Constructor Details
#initialize ⇒ CHMFile
Returns a new instance of CHMFile.
9 10 11 12 13 14 15 |
# File 'lib/cabriolet/models/chm_file.rb', line 9 def initialize @next_file = nil @section = nil @offset = 0 @length = 0 @filename = "" end |
Instance Attribute Details
#filename ⇒ Object
Returns the value of attribute filename.
7 8 9 |
# File 'lib/cabriolet/models/chm_file.rb', line 7 def filename @filename end |
#length ⇒ Object
Returns the value of attribute length.
7 8 9 |
# File 'lib/cabriolet/models/chm_file.rb', line 7 def length @length end |
#next_file ⇒ Object
Returns the value of attribute next_file.
7 8 9 |
# File 'lib/cabriolet/models/chm_file.rb', line 7 def next_file @next_file end |
#offset ⇒ Object
Returns the value of attribute offset.
7 8 9 |
# File 'lib/cabriolet/models/chm_file.rb', line 7 def offset @offset end |
#section ⇒ Object
Returns the value of attribute section.
7 8 9 |
# File 'lib/cabriolet/models/chm_file.rb', line 7 def section @section end |
Instance Method Details
#empty? ⇒ Boolean
Check if this is an empty file
23 24 25 |
# File 'lib/cabriolet/models/chm_file.rb', line 23 def empty? length.zero? end |
#system_file? ⇒ Boolean
Check if this is a system file (starts with ::)
18 19 20 |
# File 'lib/cabriolet/models/chm_file.rb', line 18 def system_file? filename.start_with?("::") end |