Class: MatchData
Instance Method Summary collapse
Instance Method Details
#to_hash ⇒ Object
427 428 429 430 431 432 |
# File 'lib/shorthand.rb', line 427 def to_hash() names = [] unless methods.include?(:names) nm = names || [] nm.size > 0 ? OrderedHash[*(nm.amap(:to_sym).zip(captures) + [[0,self[0]]]).flatten] : OrderedHash[*(0..size-1).to_a.zip(to_a).flatten] end |