Class: Sparrowhawk::FileEntry

Inherits:
Object
  • Object
show all
Defined in:
lib/sparrowhawk/file_entry.rb

Direct Known Subclasses

GemfileEntry, JarEntry, LockfileEntry

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(entry_name, file_name) ⇒ FileEntry


7
8
9
10
# File 'lib/sparrowhawk/file_entry.rb', line 7

def initialize entry_name, file_name
  @name = entry_name
  @source = file_name
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name


5
6
7
# File 'lib/sparrowhawk/file_entry.rb', line 5

def name
  @name
end

#sourceObject (readonly)

Returns the value of attribute source


5
6
7
# File 'lib/sparrowhawk/file_entry.rb', line 5

def source
  @source
end

Instance Method Details

#contentObject


12
13
14
# File 'lib/sparrowhawk/file_entry.rb', line 12

def content
  IO.read(source)
end