Class: Metacrunch::File::Entry

Inherits:
Object
  • Object
show all
Defined in:
lib/metacrunch/file/entry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filename:, archive_filename: nil, contents: nil) ⇒ Entry

Returns a new instance of Entry.



8
9
10
11
12
# File 'lib/metacrunch/file/entry.rb', line 8

def initialize(filename:, archive_filename: nil, contents: nil)
  @filename         = filename
  @archive_filename = archive_filename.presence
  @contents         = contents
end

Instance Attribute Details

#archive_filenameObject (readonly)

Returns the value of attribute archive_filename.



6
7
8
# File 'lib/metacrunch/file/entry.rb', line 6

def archive_filename
  @archive_filename
end

#contentsObject (readonly)

Returns the value of attribute contents.



6
7
8
# File 'lib/metacrunch/file/entry.rb', line 6

def contents
  @contents
end

#filenameObject (readonly)

Returns the value of attribute filename.



6
7
8
# File 'lib/metacrunch/file/entry.rb', line 6

def filename
  @filename
end

Instance Method Details

#from_archive?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/metacrunch/file/entry.rb', line 14

def from_archive?
  @archive_filename != nil
end