Class: Packman::Funpackfile
- Inherits:
-
Object
- Object
- Packman::Funpackfile
- Defined in:
- lib/packman/Funpackfile.rb
Instance Method Summary collapse
- #[](name) ⇒ Object
-
#initialize(filename = nil) ⇒ Funpackfile
constructor
A new instance of Funpackfile.
- #load(filename) ⇒ Object
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 |