Class: Packman::Funpackfile

Inherits:
Object
  • Object
show all
Defined in:
lib/packman/Funpackfile.rb

Instance Method Summary collapse

Constructor Details

#initialize(filename = nil) ⇒ Funpackfile

Returns a new instance of Funpackfile.



5
6
7
8
# File 'lib/packman/Funpackfile.rb', line 5

def initialize(filename=nil)
  @hash = {}
  load(filename) if filename
end

Instance Method Details

#[](name) ⇒ Object



14
15
16
# File 'lib/packman/Funpackfile.rb', line 14

def [](name)
  @hash[name]
end

#load(filename) ⇒ Object



10
11
12
# File 'lib/packman/Funpackfile.rb', line 10

def load(filename)
  @hash = JSON.load(File.read(filename))
end