Class: Cabriolet::Models::CHMFile

Inherits:
Object
  • Object
show all
Defined in:
lib/cabriolet/models/chm_file.rb

Overview

Represents a file within a CHM archive

Instance Attribute Summary collapse

Instance Method Summary collapse

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

Returns:

  • (Boolean)


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 ::)

Returns:

  • (Boolean)


18
19
20
# File 'lib/cabriolet/models/chm_file.rb', line 18

def system_file?
  filename.start_with?("::")
end