Class: Peacock::ParseHash
- Inherits:
-
Object
- Object
- Peacock::ParseHash
- Defined in:
- lib/peacock/parse_hash.rb
Instance Attribute Summary collapse
-
#hash ⇒ Object
readonly
Returns the value of attribute hash.
Instance Method Summary collapse
-
#initialize ⇒ ParseHash
constructor
A new instance of ParseHash.
- #push(type, str) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize ⇒ ParseHash
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
#hash ⇒ Object (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_s ⇒ Object
18 19 20 |
# File 'lib/peacock/parse_hash.rb', line 18 def to_s hash.to_s end |