Class: Peacock::ParseHash

Inherits:
Object
  • Object
show all
Defined in:
lib/peacock/parse_hash.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeParseHash

Returns a new instance of ParseHash.



7
8
9
10
11
12
# File 'lib/peacock/parse_hash.rb', line 7

def initialize
  @hash = Hash.new
  @hash[:opts] = Array.new
  @hash[:files] = Array.new
  @hash[:dirs] = Array.new
end

Instance Attribute Details

#hashObject (readonly)

Returns the value of attribute hash.



5
6
7
# File 'lib/peacock/parse_hash.rb', line 5

def hash
  @hash
end

Instance Method Details

#push(type, str) ⇒ Object



14
15
16
# File 'lib/peacock/parse_hash.rb', line 14

def push(type, str)
  @hash[type].push(str)
end

#to_sObject



18
19
20
# File 'lib/peacock/parse_hash.rb', line 18

def to_s
  hash.to_s
end