Sha256: 418620523392ded669dea34f9a5a17b05a98420e53817adb5c466594c94fa97c

Contents?: true

Size: 434 Bytes

Versions: 17

Compression:

Stored size: 434 Bytes

Contents

class Array
    ##
    # This method will return the argument value.
    # = Example
    #   ["svn", "--email", "ronghai@test.com"].option!('--email)' => "ronghai@test.com"
    #   And the list will be ["svn"]
    #   get option index --email index, delete --email, then delete value next to --email
    def option!(opt)
      if i = self.index(opt)         
        return self.delete_at(i) && self.delete_at(i)
      end
    end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
l5m-tools-0.2.0 lib/l5m-tools/array.rb
l5m-tools-0.1.4 lib/l5m-tools/array.rb
l5m-tools-0.1.3 lib/l5m-tools/array.rb
l5m-tools-0.1.2 lib/l5m-tools/array.rb
l5m-tools-0.1.1 lib/l5m-tools/array.rb
l5m-tools-0.1.0 lib/l5m-tools/array.rb
l5m-tools-0.0.11 lib/l5m-tools/array.rb
l5m-tools-0.0.10 lib/l5m-tools/array.rb
l5m-tools-0.0.9 lib/l5m-tools/array.rb
l5m-tools-0.0.8 lib/l5m-tools/array.rb
l5m-tools-0.0.7 lib/l5m-tools/array.rb
l5m-tools-0.0.6 lib/l5m-tools/array.rb
l5m-tools-0.0.5 lib/l5m-tools/array.rb
l5m-tools-0.0.4 lib/l5m-tools/array.rb
l5m-tools-0.0.3 lib/l5m-tools/array.rb
l5m-tools-0.0.2 lib/l5m-tools/array.rb
l5m-tools-0.0.2.beta lib/l5m-tools/array.rb