Class: SCParse::CommandHash
- Inherits:
-
Hash
- Object
- Hash
- SCParse::CommandHash
- Defined in:
- lib/scparse.rb
Instance Method Summary collapse
-
#[](name) ⇒ Object
Find first key that begins with the name passed.
Instance Method Details
#[](name) ⇒ Object
Find first key that begins with the name passed
46 47 48 49 |
# File 'lib/scparse.rb', line 46 def [](name) possible = keys.select {|key| key =~ /^#{name}.*/} fetch(possible[0]) if possible.length == 1 end |